Path: blob/master/runtime/compiler/optimizer/J9CallGraph.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#include "optimizer/CallInfo.hpp"23#include "il/J9DataTypes.hpp"2425class TR_ResolvedMethod;262728class TR_ProfileableCallSite : public TR_IndirectCallSite29{30public:31virtual bool findProfiledCallTargets (TR_CallStack *callStack, TR_InlinerBase* inliner);3233protected :34TR_CALLSITE_TR_ALLOC_AND_INHERIT_EMPTY_CONSTRUCTOR(TR_ProfileableCallSite, TR_IndirectCallSite)35//capabilities36void findSingleProfiledReceiver(ListIterator<TR_ExtraAddressInfo>&, TR_AddressInfo * valueInfo, TR_InlinerBase* inliner);37virtual void findSingleProfiledMethod(ListIterator<TR_ExtraAddressInfo>&, TR_AddressInfo * valueInfo, TR_InlinerBase* inliner);38virtual TR_YesNoMaybe isCallingObjectMethod() { return TR_maybe; };39};404142class TR_J9MethodHandleCallSite : public TR_FunctionPointerCallSite43{44public:45TR_CALLSITE_TR_ALLOC_AND_INHERIT_EMPTY_CONSTRUCTOR(TR_J9MethodHandleCallSite, TR_FunctionPointerCallSite)46virtual bool findCallSiteTarget (TR_CallStack *callStack, TR_InlinerBase* inliner);47virtual const char* name () { return "TR_J9MethodHandleCallSite"; }48};495051class TR_J9MutableCallSite : public TR_FunctionPointerCallSite52{53public:54TR_CALLSITE_TR_ALLOC_AND_INHERIT_CONSTRUCTOR(TR_J9MutableCallSite, TR_FunctionPointerCallSite) { _mcsReferenceLocation = NULL; };55virtual bool findCallSiteTarget (TR_CallStack *callStack, TR_InlinerBase* inliner);56virtual const char* name () { return "TR_J9MutableCallSite"; }57virtual void setMCSReferenceLocation(uintptr_t *mcsReferenceLocation) { _mcsReferenceLocation = mcsReferenceLocation; }58private:59uintptr_t * _mcsReferenceLocation;60};6162class TR_J9VirtualCallSite : public TR_ProfileableCallSite63{64public:65TR_CALLSITE_TR_ALLOC_AND_INHERIT_CONSTRUCTOR(TR_J9VirtualCallSite, TR_ProfileableCallSite) { _isCallingObjectMethod = TR_maybe; }66virtual bool findCallSiteTarget (TR_CallStack *callStack, TR_InlinerBase* inliner);67virtual TR_ResolvedMethod* findSingleJittedImplementer (TR_InlinerBase *inliner);68virtual const char* name () { return "TR_J9VirtualCallSite"; }6970protected:71//capabilities72bool findCallSiteForAbstractClass(TR_InlinerBase* inliner);73//queries74bool isBasicInvokeVirtual();75virtual TR_OpaqueClassBlock* getClassFromMethod ();76// Is the call site calling a method of java/lang/Object77virtual TR_YesNoMaybe isCallingObjectMethod() { return _isCallingObjectMethod; };78private:79TR_YesNoMaybe _isCallingObjectMethod;8081};8283class TR_J9InterfaceCallSite : public TR_ProfileableCallSite84{8586public:87TR_CALLSITE_TR_ALLOC_AND_INHERIT_EMPTY_CONSTRUCTOR(TR_J9InterfaceCallSite, TR_ProfileableCallSite)88virtual bool findCallSiteTarget (TR_CallStack *callStack, TR_InlinerBase* inliner);89virtual TR_OpaqueClassBlock* getClassFromMethod ();90virtual const char* name () { return "TR_J9InterfaceCallSite"; }91protected:92virtual TR_ResolvedMethod* getResolvedMethod (TR_OpaqueClassBlock* klass);93virtual void findSingleProfiledMethod(ListIterator<TR_ExtraAddressInfo>&, TR_AddressInfo * valueInfo, TR_InlinerBase* inliner);9495};96979899