Book a Demo!
CoCalc Logo Icon
StoreFeaturesDocsShareSupportNewsAboutPoliciesSign UpSign In
PojavLauncherTeam
GitHub Repository: PojavLauncherTeam/openj9
Path: blob/master/runtime/compiler/ilgen/ClassLookahead.hpp
6000 views
1
/*******************************************************************************
2
* Copyright (c) 2000, 2016 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
#ifndef ClassLookahead_h
24
#define ClassLookahead_h
25
26
#include "compile/Compilation.hpp"
27
#include "env/CHTable.hpp"
28
#include "env/VMJ9.h"
29
30
class TR_ClassLookahead
31
{
32
public:
33
TR_ALLOC(TR_Memory::ClassLookahead)
34
35
TR_ClassLookahead(TR_PersistentClassInfo *, TR_FrontEnd *, TR::Compilation *, TR::SymbolReferenceTable *);
36
int32_t perform();
37
38
TR_PersistentArrayFieldInfo *getExistingArrayFieldInfo(TR::Symbol *, TR::SymbolReference *);
39
TR_PersistentFieldInfo *getExistingFieldInfo(TR::Symbol *, TR::SymbolReference *, bool canMorph = true);
40
41
void findInitializerMethods(List<TR_ResolvedMethod> *, List<TR::ResolvedMethodSymbol> *, List<TR::ResolvedMethodSymbol> *, TR::ResolvedMethodSymbol **, bool *peekFailedForAnyMethod);
42
void initializeFieldInfo();
43
void updateFieldInfo();
44
void makeInfoPersistent();
45
46
bool examineNode(TR::TreeTop *, TR::Node *, TR::Node *, int32_t, TR::Node *, vcount_t);
47
void invalidateIfEscapingLoad(TR::TreeTop *, TR::Node *, TR::Node *, int32_t, TR::Node *);
48
bool isProperFieldAccess(TR::Node *);
49
bool isPrivateFieldAccess(TR::Node *);
50
51
TR::Compilation * comp() {return _compilation;}
52
TR_FrontEnd * fe() {return _fe;}
53
TR_J9VMBase * fej9() {return (TR_J9VMBase *)_fe; }
54
TR_Debug * getDebug() {return _compilation->getDebug();}
55
56
// Checking NaN
57
//void TR_ClassLookahead::checkAndInvalidateNonNaNProperty(TR::Node *, TR_PersistentFieldInfo *);
58
//int32_t TR_ClassLookahead::mustNotContainNaN(TR::Node *);
59
60
bool findMethod(List<TR::ResolvedMethodSymbol> *, TR::ResolvedMethodSymbol *);
61
62
static char *getFieldSignature(TR::Compilation *, TR::Symbol *, TR::SymbolReference *, int32_t &length);
63
64
private:
65
// data
66
//
67
TR_FrontEnd * _fe;
68
TR::Compilation * _compilation;
69
TR::SymbolReferenceTable * _symRefTab;
70
TR_OpaqueClassBlock * _classPointer;
71
TR_PersistentClassInfoForFields * _classFieldInfo;
72
TR_PersistentClassInfo * _classInfo;
73
TR::ResolvedMethodSymbol * _currentMethodSymbol;
74
bool _inFirstBlock;
75
bool _inInitializerMethod;
76
bool _inFirstInitializerMethod;
77
bool _inClassInitializerMethod;
78
bool _traceIt;
79
};
80
81
#endif
82
83
84
85
86
87
88
89