diff --git a/runtime/compiler/CMakeLists.txt b/runtime/compiler/CMakeLists.txt index c817349d71d..3577dbbc3b0 100644 --- a/runtime/compiler/CMakeLists.txt +++ b/runtime/compiler/CMakeLists.txt @@ -316,6 +316,8 @@ endif() # Add optional user-specified compiler flags that only apply to the JIT. list(APPEND J9_CFLAGS ${J9JIT_EXTRA_CFLAGS}) list(APPEND J9_CXXFLAGS ${J9JIT_EXTRA_CXXFLAGS}) +#list(APPEND J9_CFLAGS ${J9JIT_EXTRA_CFLAGS} "-DPROD_WITH_ASSUMES") +#list(APPEND J9_CXXFLAGS ${J9JIT_EXTRA_CXXFLAGS} "-DPROD_WITH_ASSUMES") # Note: J9_CFLAGS and J9_CXXFLAGS are appended after J9_SHAREDFLAGS so that # OMR_PLATFORM_C_COMPILE_OPTIONS and OMR_PLATFORM_CXX_COMPILE_OPTIONS diff --git a/runtime/compiler/env/j9method.cpp b/runtime/compiler/env/j9method.cpp index 41c7b767625..bb82ea6765a 100644 --- a/runtime/compiler/env/j9method.cpp +++ b/runtime/compiler/env/j9method.cpp @@ -22,6 +22,7 @@ #include "env/j9method.h" +#include #include #include "bcnames.h" #include "fastJNI.h" @@ -222,11 +223,15 @@ TR_J9VMBase::createResolvedMethodWithSignature(TR_Memory * trMemory, TR_OpaqueMe #if defined(J9VM_OPT_SHARED_CLASSES) && (defined(TR_HOST_X86) || defined(TR_HOST_POWER) || defined(TR_HOST_S390) || defined(TR_HOST_ARM) || defined(TR_HOST_ARM64)) #if defined(J9VM_OPT_JITSERVER) if (_compInfoPT->getMethodBeingCompiled()->_useAOTCacheCompilation) + { + printf("Creating aMethod %p 1\n", aMethod); result = new (trMemory->trHeapMemory()) TR_ResolvedRelocatableJ9Method(aMethod, this, trMemory, owningMethod, vTableSlot); + } else #endif /* defined(J9VM_OPT_JITSERVER) */ if (TR::Options::sharedClassCache()) { + printf("Creating aMethod %p 2\n", aMethod); result = new (trMemory->trHeapMemory()) TR_ResolvedRelocatableJ9Method(aMethod, this, trMemory, owningMethod, vTableSlot); TR::Compilation *comp = TR::comp(); if (comp && comp->getOption(TR_UseSymbolValidationManager)) @@ -1009,7 +1014,14 @@ TR_ResolvedRelocatableJ9Method::TR_ResolvedRelocatableJ9Method(TR_OpaqueMethodBl if (comp->getOption(TR_UseSymbolValidationManager)) { TR::SymbolValidationManager *svm = comp->getSymbolValidationManager(); + + if (!svm->isAlreadyValidated(aMethod)) + { + printf("Failure Checking %p\n", aMethod); + } + SVM_ASSERT_ALREADY_VALIDATED(svm, aMethod); + SVM_ASSERT_ALREADY_VALIDATED(svm, containingClass()); } else if (owner) @@ -1867,6 +1879,7 @@ TR_ResolvedRelocatableJ9Method::createResolvedMethodFromJ9Method(TR::Compilation (sameLoaders = fej9->sameClassLoaders(clazzOfInlinedMethod, clazzOfCompiledMethod)) || isSystemClassLoader) { + printf("Creating aMethod %p 3\n", j9method); resolvedMethod = new (comp->trHeapMemory()) TR_ResolvedRelocatableJ9Method((TR_OpaqueMethodBlock *) j9method, _fe, comp->trMemory(), this, vTableSlot); if (!ignoringLocalSCC && comp->getOption(TR_UseSymbolValidationManager)) { @@ -7132,6 +7145,7 @@ TR_ResolvedJ9Method::getResolvedVirtualMethod(TR::Compilation * comp, TR_OpaqueC TR_ResolvedMethod *m; if (_fe->isAOT_DEPRECATED_DO_NOT_USE()) { + printf("Creating aMethod %p 4\n", ramMethod); m = ramMethod ? new (comp->trHeapMemory()) TR_ResolvedRelocatableJ9Method((TR_OpaqueMethodBlock *) ramMethod, _fe, comp->trMemory(), this) : 0; } else diff --git a/runtime/compiler/env/j9methodServer.cpp b/runtime/compiler/env/j9methodServer.cpp index f400eb25e30..3a311707d03 100644 --- a/runtime/compiler/env/j9methodServer.cpp +++ b/runtime/compiler/env/j9methodServer.cpp @@ -20,6 +20,7 @@ * SPDX-License-Identifier: EPL-2.0 OR Apache-2.0 OR GPL-2.0-only WITH Classpath-exception-2.0 OR GPL-2.0-only WITH OpenJDK-assembly-exception-1.0 *******************************************************************************/ +#include #include "j9methodServer.hpp" #include "control/CompilationRuntime.hpp" #include "control/CompilationThread.hpp" @@ -1343,7 +1344,10 @@ TR_ResolvedJ9JITServerMethod::createResolvedMethodMirror(TR_ResolvedJ9JITServerM if (!((TR_J9VMBase *) fe)->isAOT_DEPRECATED_DO_NOT_USE()) resolvedMethod = new (trMemory->trHeapMemory()) TR_ResolvedJ9Method(method, fe, trMemory, owningMethod, vTableSlot); else + { + printf("Creating aMethod %p 5\n", method); resolvedMethod = new (trMemory->trHeapMemory()) TR_ResolvedRelocatableJ9Method(method, fe, trMemory, owningMethod, vTableSlot); + } if (!resolvedMethod) throw std::bad_alloc(); packMethodInfo(methodInfo, resolvedMethod, fe); @@ -1398,6 +1402,7 @@ TR_ResolvedJ9JITServerMethod::createResolvedMethodFromJ9MethodMirror(TR_Resolved (sameLoaders = fej9->sameClassLoaders(clazzOfInlinedMethod, clazzOfCompiledMethod)) || isSystemClassLoader) { + printf("Creating aMethod %p 6\n", j9method); resolvedMethod = new (comp->trHeapMemory()) TR_ResolvedRelocatableJ9Method((TR_OpaqueMethodBlock *) j9method, fe, comp->trMemory(), owningMethod, vTableSlot); if (!resolvedMethod) throw std::bad_alloc(); } diff --git a/runtime/compiler/optimizer/OSRGuardInsertion.cpp b/runtime/compiler/optimizer/OSRGuardInsertion.cpp index 3ceea958b19..e97f624f647 100644 --- a/runtime/compiler/optimizer/OSRGuardInsertion.cpp +++ b/runtime/compiler/optimizer/OSRGuardInsertion.cpp @@ -348,7 +348,6 @@ void TR_OSRGuardInsertion::removeHCRGuards(TR_BitVector &fearGeneratingNodes, TR if (!node->isTheVirtualGuardForAGuardedInlinedCall()) { continue; } TR_VirtualGuard *guardInfo = comp()->findVirtualGuardInfo(node); TR_ASSERT(guardInfo, "we expect to get virtual guard info in HCRGuardRemoval!"); - TR_ASSERT(!guardInfo->getByteCodeInfo().isInvalidByteCodeIndex(), "we expect to get valid bytecode info for a virtual guard!"); if (!guardAnalysis || guardAnalysis->_blockAnalysisInfo[cursor->getNextBlock()->getNumber()]->isEmpty()) { diff --git a/runtime/compiler/runtime/SymbolValidationManager.cpp b/runtime/compiler/runtime/SymbolValidationManager.cpp index 4d7cb23e238..8f30a006466 100644 --- a/runtime/compiler/runtime/SymbolValidationManager.cpp +++ b/runtime/compiler/runtime/SymbolValidationManager.cpp @@ -561,8 +561,10 @@ TR::SymbolValidationManager::appendNewRecord(void *value, TR::SymbolValidationRe SVM_ASSERT(!inHeuristicRegion(), "Attempted to appendNewRecord in a heuristic region"); TR_ASSERT(!recordExists(record), "record is not new"); + printf("Appending new record value %p\n", value); if (!isAlreadyValidated(value)) { + printf("Appending new record value %p 2\n", value); _valueToSymbolMap.insert(std::make_pair(value, getNewSymbolID())); } _symbolValidationRecords.push_front(record); @@ -959,6 +961,7 @@ TR::SymbolValidationManager::addStaticMethodFromCPRecord(TR_OpaqueMethodBlock *m { TR_OpaqueClassBlock *beholder = _fej9->getClassFromCP(cp); SVM_ASSERT_ALREADY_VALIDATED(this, beholder); + printf("adding new method record %p 1\n", method); return addMethodRecord(new (_region) StaticMethodFromCPRecord(method, beholder, cpIndex)); } @@ -967,6 +970,7 @@ TR::SymbolValidationManager::addSpecialMethodFromCPRecord(TR_OpaqueMethodBlock * { TR_OpaqueClassBlock *beholder = _fej9->getClassFromCP(cp); SVM_ASSERT_ALREADY_VALIDATED(this, beholder); + printf("adding new method record %p 2\n", method); return addMethodRecord(new (_region) SpecialMethodFromCPRecord(method, beholder, cpIndex)); } @@ -975,6 +979,7 @@ TR::SymbolValidationManager::addVirtualMethodFromCPRecord(TR_OpaqueMethodBlock * { TR_OpaqueClassBlock *beholder = _fej9->getClassFromCP(cp); SVM_ASSERT_ALREADY_VALIDATED(this, beholder); + printf("adding new method record %p 3\n", method); return addMethodRecord(new (_region) VirtualMethodFromCPRecord(method, beholder, cpIndex)); } @@ -989,6 +994,7 @@ TR::SymbolValidationManager::addVirtualMethodFromOffsetRecord(TR_OpaqueMethodBlo if (virtualCallOffset != (int32_t)(int16_t)virtualCallOffset) return false; // not enough space in the record + printf("adding new method record %p 4\n", method); return addMethodRecord(new (_region) VirtualMethodFromOffsetRecord(method, beholder, virtualCallOffset, ignoreRtResolve)); } @@ -997,6 +1003,7 @@ TR::SymbolValidationManager::addInterfaceMethodFromCPRecord(TR_OpaqueMethodBlock { SVM_ASSERT_ALREADY_VALIDATED(this, beholder); SVM_ASSERT_ALREADY_VALIDATED(this, lookup); + printf("adding new method record %p 5\n", method); return addMethodRecord(new (_region) InterfaceMethodFromCPRecord(method, beholder, lookup, cpIndex)); } @@ -1005,6 +1012,7 @@ TR::SymbolValidationManager::addImproperInterfaceMethodFromCPRecord(TR_OpaqueMet { TR_OpaqueClassBlock *beholder = _fej9->getClassFromCP(cp); SVM_ASSERT_ALREADY_VALIDATED(this, beholder); + printf("adding new method record %p 6\n", method); return addMethodRecord(new (_region) ImproperInterfaceMethodFromCPRecord(method, beholder, cpIndex)); } @@ -1017,6 +1025,8 @@ TR::SymbolValidationManager::addMethodFromClassAndSignatureRecord(TR_OpaqueMetho SVM_ASSERT_ALREADY_VALIDATED(this, lookupClass); SVM_ASSERT_ALREADY_VALIDATED(this, beholder); + + printf("adding new method record %p 7\n", method); return addMethodRecord(new (_region) MethodFromClassAndSigRecord(method, lookupClass, beholder)); } @@ -1029,6 +1039,7 @@ TR::SymbolValidationManager::addMethodFromSingleImplementerRecord(TR_OpaqueMetho { SVM_ASSERT_ALREADY_VALIDATED(this, thisClass); SVM_ASSERT_ALREADY_VALIDATED(this, callerMethod); + printf("adding new method record %p 8\n", method); return addMethodRecord(new (_region) MethodFromSingleImplementer(method, thisClass, cpIndexOrVftSlot, callerMethod, useGetResolvedInterfaceMethod)); } @@ -1040,6 +1051,7 @@ TR::SymbolValidationManager::addMethodFromSingleInterfaceImplementerRecord(TR_Op { SVM_ASSERT_ALREADY_VALIDATED(this, thisClass); SVM_ASSERT_ALREADY_VALIDATED(this, callerMethod); + printf("adding new method record %p 9\n", method); return addMethodRecord(new (_region) MethodFromSingleInterfaceImplementer(method, thisClass, cpIndex, callerMethod)); } @@ -1051,6 +1063,7 @@ TR::SymbolValidationManager::addMethodFromSingleAbstractImplementerRecord(TR_Opa { SVM_ASSERT_ALREADY_VALIDATED(this, thisClass); SVM_ASSERT_ALREADY_VALIDATED(this, callerMethod); + printf("adding new method record %p a\n", method); return addMethodRecord(new (_region) MethodFromSingleAbstractImplementer(method, thisClass, vftSlot, callerMethod)); }