Book a Demo!
CoCalc Logo Icon
StoreFeaturesDocsShareSupportNewsAboutPoliciesSign UpSign In
PojavLauncherTeam
GitHub Repository: PojavLauncherTeam/openj9
Path: blob/master/runtime/compiler/optimizer/J9CallGraph.hpp
6000 views
1
/*******************************************************************************
2
* Copyright (c) 2000, 2021 IBM Corp. and others
3
*
4
* This program and the accompanying materials are made available under
5
* the terms of the Eclipse Public License 2.0 which accompanies this
6
* distribution and is available at https://www.eclipse.org/legal/epl-2.0/
7
* or the Apache License, Version 2.0 which accompanies this distribution and
8
* is available at https://www.apache.org/licenses/LICENSE-2.0.
9
*
10
* This Source Code may also be made available under the following
11
* Secondary Licenses when the conditions for such availability set
12
* forth in the Eclipse Public License, v. 2.0 are satisfied: GNU
13
* General Public License, version 2 with the GNU Classpath
14
* Exception [1] and GNU General Public License, version 2 with the
15
* OpenJDK Assembly Exception [2].
16
*
17
* [1] https://www.gnu.org/software/classpath/license.html
18
* [2] http://openjdk.java.net/legal/assembly-exception.html
19
*
20
* 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-exception
21
*******************************************************************************/
22
23
#include "optimizer/CallInfo.hpp"
24
#include "il/J9DataTypes.hpp"
25
26
class TR_ResolvedMethod;
27
28
29
class TR_ProfileableCallSite : public TR_IndirectCallSite
30
{
31
public:
32
virtual bool findProfiledCallTargets (TR_CallStack *callStack, TR_InlinerBase* inliner);
33
34
protected :
35
TR_CALLSITE_TR_ALLOC_AND_INHERIT_EMPTY_CONSTRUCTOR(TR_ProfileableCallSite, TR_IndirectCallSite)
36
//capabilities
37
void findSingleProfiledReceiver(ListIterator<TR_ExtraAddressInfo>&, TR_AddressInfo * valueInfo, TR_InlinerBase* inliner);
38
virtual void findSingleProfiledMethod(ListIterator<TR_ExtraAddressInfo>&, TR_AddressInfo * valueInfo, TR_InlinerBase* inliner);
39
virtual TR_YesNoMaybe isCallingObjectMethod() { return TR_maybe; };
40
};
41
42
43
class TR_J9MethodHandleCallSite : public TR_FunctionPointerCallSite
44
{
45
public:
46
TR_CALLSITE_TR_ALLOC_AND_INHERIT_EMPTY_CONSTRUCTOR(TR_J9MethodHandleCallSite, TR_FunctionPointerCallSite)
47
virtual bool findCallSiteTarget (TR_CallStack *callStack, TR_InlinerBase* inliner);
48
virtual const char* name () { return "TR_J9MethodHandleCallSite"; }
49
};
50
51
52
class TR_J9MutableCallSite : public TR_FunctionPointerCallSite
53
{
54
public:
55
TR_CALLSITE_TR_ALLOC_AND_INHERIT_CONSTRUCTOR(TR_J9MutableCallSite, TR_FunctionPointerCallSite) { _mcsReferenceLocation = NULL; };
56
virtual bool findCallSiteTarget (TR_CallStack *callStack, TR_InlinerBase* inliner);
57
virtual const char* name () { return "TR_J9MutableCallSite"; }
58
virtual void setMCSReferenceLocation(uintptr_t *mcsReferenceLocation) { _mcsReferenceLocation = mcsReferenceLocation; }
59
private:
60
uintptr_t * _mcsReferenceLocation;
61
};
62
63
class TR_J9VirtualCallSite : public TR_ProfileableCallSite
64
{
65
public:
66
TR_CALLSITE_TR_ALLOC_AND_INHERIT_CONSTRUCTOR(TR_J9VirtualCallSite, TR_ProfileableCallSite) { _isCallingObjectMethod = TR_maybe; }
67
virtual bool findCallSiteTarget (TR_CallStack *callStack, TR_InlinerBase* inliner);
68
virtual TR_ResolvedMethod* findSingleJittedImplementer (TR_InlinerBase *inliner);
69
virtual const char* name () { return "TR_J9VirtualCallSite"; }
70
71
protected:
72
//capabilities
73
bool findCallSiteForAbstractClass(TR_InlinerBase* inliner);
74
//queries
75
bool isBasicInvokeVirtual();
76
virtual TR_OpaqueClassBlock* getClassFromMethod ();
77
// Is the call site calling a method of java/lang/Object
78
virtual TR_YesNoMaybe isCallingObjectMethod() { return _isCallingObjectMethod; };
79
private:
80
TR_YesNoMaybe _isCallingObjectMethod;
81
82
};
83
84
class TR_J9InterfaceCallSite : public TR_ProfileableCallSite
85
{
86
87
public:
88
TR_CALLSITE_TR_ALLOC_AND_INHERIT_EMPTY_CONSTRUCTOR(TR_J9InterfaceCallSite, TR_ProfileableCallSite)
89
virtual bool findCallSiteTarget (TR_CallStack *callStack, TR_InlinerBase* inliner);
90
virtual TR_OpaqueClassBlock* getClassFromMethod ();
91
virtual const char* name () { return "TR_J9InterfaceCallSite"; }
92
protected:
93
virtual TR_ResolvedMethod* getResolvedMethod (TR_OpaqueClassBlock* klass);
94
virtual void findSingleProfiledMethod(ListIterator<TR_ExtraAddressInfo>&, TR_AddressInfo * valueInfo, TR_InlinerBase* inliner);
95
96
};
97
98
99