Book a Demo!
CoCalc Logo Icon
StoreFeaturesDocsShareSupportNewsAboutPoliciesSign UpSign In
PojavLauncherTeam
GitHub Repository: PojavLauncherTeam/openj9
Path: blob/master/runtime/gc_structs/ClassIteratorClassSlots.cpp
5990 views
1
2
/*******************************************************************************
3
* Copyright (c) 1991, 2021 IBM Corp. and others
4
*
5
* This program and the accompanying materials are made available under
6
* the terms of the Eclipse Public License 2.0 which accompanies this
7
* distribution and is available at https://www.eclipse.org/legal/epl-2.0/
8
* or the Apache License, Version 2.0 which accompanies this distribution and
9
* is available at https://www.apache.org/licenses/LICENSE-2.0.
10
*
11
* This Source Code may also be made available under the following
12
* Secondary Licenses when the conditions for such availability set
13
* forth in the Eclipse Public License, v. 2.0 are satisfied: GNU
14
* General Public License, version 2 with the GNU Classpath
15
* Exception [1] and GNU General Public License, version 2 with the
16
* OpenJDK Assembly Exception [2].
17
*
18
* [1] https://www.gnu.org/software/classpath/license.html
19
* [2] http://openjdk.java.net/legal/assembly-exception.html
20
*
21
* 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
22
*******************************************************************************/
23
24
/**
25
* @file
26
* @ingroup GC_Structs
27
*/
28
29
#include "j9.h"
30
#include "j9cfg.h"
31
32
#include "ClassIteratorClassSlots.hpp"
33
34
/**
35
* @return the next non-NULL class reference
36
* @return NULL if there are no more such references
37
*/
38
J9Class *
39
GC_ClassIteratorClassSlots::nextSlot()
40
{
41
J9Class *classPtr;
42
43
switch(_state) {
44
case classiteratorclassslots_state_start:
45
_state += 1;
46
47
case classiteratorclassslots_state_constant_pool:
48
classPtr = _constantPoolClassSlotIterator.nextSlot();
49
if (NULL != classPtr) {
50
return classPtr;
51
}
52
_state += 1;
53
54
case classiteratorclassslots_state_superclasses:
55
classPtr = _classSuperclassesIterator.nextSlot();
56
if (NULL != classPtr) {
57
return classPtr;
58
}
59
_state += 1;
60
61
case classiteratorclassslots_state_interfaces:
62
/*
63
* Checking sharedITable is an optimization that only checks booleanArrayClass Interfaces
64
* since all array claseses share the same ITable.
65
*/
66
if (_shouldScanInterfaces) {
67
classPtr = _classLocalInterfaceIterator.nextSlot();
68
if (NULL != classPtr) {
69
return classPtr;
70
}
71
}
72
_state += 1;
73
74
case classiteratorclassslots_state_array_class_slots:
75
classPtr = _classArrayClassSlotIterator.nextSlot();
76
if (NULL != classPtr) {
77
return classPtr;
78
}
79
_state += 1;
80
81
case classiteratorclassslots_state_flattened_class_cache_slots:
82
classPtr = _classFCCSlotIterator.nextSlot();
83
if (NULL != classPtr) {
84
return classPtr;
85
}
86
_state += 1;
87
88
case classiteratorclassslots_state_end:
89
default:
90
break;
91
}
92
93
return NULL;
94
}
95
96
97