Path: blob/master/runtime/compiler/compile/AOTClassInfo.hpp
6000 views
/*******************************************************************************1* Copyright (c) 2000, 2021 IBM Corp. and others2*3* This program and the accompanying materials are made available under4* the terms of the Eclipse Public License 2.0 which accompanies this5* distribution and is available at https://www.eclipse.org/legal/epl-2.0/6* or the Apache License, Version 2.0 which accompanies this distribution and7* is available at https://www.apache.org/licenses/LICENSE-2.0.8*9* This Source Code may also be made available under the following10* Secondary Licenses when the conditions for such availability set11* forth in the Eclipse Public License, v. 2.0 are satisfied: GNU12* General Public License, version 2 with the GNU Classpath13* Exception [1] and GNU General Public License, version 2 with the14* OpenJDK Assembly Exception [2].15*16* [1] https://www.gnu.org/software/classpath/license.html17* [2] http://openjdk.java.net/legal/assembly-exception.html18*19* SPDX-License-Identifier: EPL-2.0 OR Apache-2.0 OR GPL-2.0 WITH Classpath-exception-2.0 OR LicenseRef-GPL-2.0 WITH Assembly-exception20*******************************************************************************/2122#ifndef TR_AOTCLASSINFO_INCL23#define TR_AOTCLASSINFO_INCL2425#include "env/FrontEnd.hpp"26#include "runtime/J9Runtime.hpp"27#include "env/jittypes.h"28#include "env/VMJ9.h"2930class AOTCacheClassChainRecord;313233// AOTClassInfo is a structure used to record assumptions on classes made by the34// current compilation. There are two types of validations: ones based on a35// constant pool entry, and ones that are not (could be recognized method where36// we don't have the cp info or could be based on profile data)37//38// TR_ValidateClass, TR_ValidateStaticField, TR_ValidateInstanceField are all39// based on a constant pool entry40//41// TR_ValidateArbitraryClass is not based on a constant pool entry42//43// First class of validation has _cpIndex >= 0, second class has _cpIndex == -144//4546namespace TR47{4849class AOTClassInfo50{51public:5253TR_ALLOC(TR_Memory::AOTClassInfo)5455AOTClassInfo(56TR_FrontEnd *fe,57TR_OpaqueClassBlock *clazz,58void *classChain,59TR_OpaqueMethodBlock *method,60uint32_t cpIndex,61TR_ExternalRelocationTargetKind reloKind,62const AOTCacheClassChainRecord *aotCacheClassChainRecord = NULL63) :64_clazz(clazz),65_classChain(classChain),66_method(method),67_constantPool((void *) ((TR_J9VMBase *)fe)->getConstantPoolFromMethod(method)),68_cpIndex(cpIndex),69_reloKind(reloKind)70{71#if defined(J9VM_OPT_JITSERVER)72TR_ASSERT(!aotCacheClassChainRecord || (fe->getPersistentInfo()->getRemoteCompilationMode() == JITServer::SERVER),73"Must always be NULL at JIT client");74_aotCacheClassChainRecord = aotCacheClassChainRecord;75#endif /* defined(J9VM_OPT_JITSERVER) */76}7778#if defined(J9VM_OPT_JITSERVER)79const AOTCacheClassChainRecord *getAOTCacheClassChainRecord() { return _aotCacheClassChainRecord; }80#else /* defined(J9VM_OPT_JITSERVER) */81const AOTCacheClassChainRecord *getAOTCacheClassChainRecord() { return NULL; }82#endif /* defined(J9VM_OPT_JITSERVER) */8384TR_ExternalRelocationTargetKind _reloKind; // identifies validation needed (instance field, static field, class, arbitrary class)85uint32_t _cpIndex; // cpindex identifying the cp entry if known otherwise -186TR_OpaqueMethodBlock *_method; // inlined method owning the cp entry or to which assumption is attached87// _method must be compiled method or some method in the inlined site table88void *_constantPool; // constant pool owning the cp entry, initialized based on _method89TR_OpaqueClassBlock *_clazz; // class on which assumption is formed90void *_classChain; // class chain for clazz: captures the assumption91// == NULL for TR_ValidateStaticField validations92#if defined(J9VM_OPT_JITSERVER)93const AOTCacheClassChainRecord *_aotCacheClassChainRecord; // NULL at JITServer if compiled method won't be cached94// Always NULL at JIT client95#endif /* defined(J9VM_OPT_JITSERVER) */96};9798}99100#endif101102103