1 /*
2 * Copyright (c) 2000, 2013, Oracle and/or its affiliates. All rights reserved.
3 * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
4 *
5 * This code is free software; you can redistribute it and/or modify it
6 * under the terms of the GNU General Public License version 2 only, as
7 * published by the Free Software Foundation.
8 *
9 * This code is distributed in the hope that it will be useful, but WITHOUT
10 * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
11 * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
12 * version 2 for more details (a copy is included in the LICENSE file that
13 * accompanied this code).
14 *
15 * You should have received a copy of the GNU General Public License version
16 * 2 along with this work; if not, write to the Free Software Foundation,
17 * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
18 *
19 * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
20 * or visit www.oracle.com if you need additional information or have any
21 * questions.
22 *
90 int32_t value; // Value of constant
91 } VMIntConstantEntry;
92
93 typedef struct {
94 const char* name; // Name of constant (example: "_thread_in_native")
95 uint64_t value; // Value of constant
96 } VMLongConstantEntry;
97
98 typedef struct {
99 const char* name; // Name of address (example: "SharedRuntime::register_finalizer")
100 void* value; // Value of address
101 } VMAddressEntry;
102
103 // This class is a friend of most classes, to be able to access
104 // private fields
105 class VMStructs {
106 public:
107 // The last entry is identified over in the serviceability agent by
108 // the fact that it has a NULL fieldName
109 static VMStructEntry localHotSpotVMStructs[];
110
111 // The last entry is identified over in the serviceability agent by
112 // the fact that it has a NULL typeName
113 static VMTypeEntry localHotSpotVMTypes[];
114
115 // Table of integer constants required by the serviceability agent.
116 // The last entry is identified over in the serviceability agent by
117 // the fact that it has a NULL typeName
118 static VMIntConstantEntry localHotSpotVMIntConstants[];
119
120 // Table of long constants required by the serviceability agent.
121 // The last entry is identified over in the serviceability agent by
122 // the fact that it has a NULL typeName
123 static VMLongConstantEntry localHotSpotVMLongConstants[];
124
125 /**
126 * Table of addresses.
127 */
128 static VMAddressEntry localHotSpotVMAddresses[];
129
130 // This is used to run any checking code necessary for validation of
131 // the data structure (debug build only)
132 static void init();
133
134 #ifndef PRODUCT
135 // Execute unit tests
136 static void test();
137 #endif
138
139 private:
140 // Look up a type in localHotSpotVMTypes using strcmp() (debug build only).
141 // Returns 1 if found, 0 if not.
142 // debug_only(static int findType(const char* typeName);)
143 static int findType(const char* typeName);
|
1 /*
2 * Copyright (c) 2000, 2016, Oracle and/or its affiliates. All rights reserved.
3 * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
4 *
5 * This code is free software; you can redistribute it and/or modify it
6 * under the terms of the GNU General Public License version 2 only, as
7 * published by the Free Software Foundation.
8 *
9 * This code is distributed in the hope that it will be useful, but WITHOUT
10 * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
11 * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
12 * version 2 for more details (a copy is included in the LICENSE file that
13 * accompanied this code).
14 *
15 * You should have received a copy of the GNU General Public License version
16 * 2 along with this work; if not, write to the Free Software Foundation,
17 * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
18 *
19 * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
20 * or visit www.oracle.com if you need additional information or have any
21 * questions.
22 *
90 int32_t value; // Value of constant
91 } VMIntConstantEntry;
92
93 typedef struct {
94 const char* name; // Name of constant (example: "_thread_in_native")
95 uint64_t value; // Value of constant
96 } VMLongConstantEntry;
97
98 typedef struct {
99 const char* name; // Name of address (example: "SharedRuntime::register_finalizer")
100 void* value; // Value of address
101 } VMAddressEntry;
102
103 // This class is a friend of most classes, to be able to access
104 // private fields
105 class VMStructs {
106 public:
107 // The last entry is identified over in the serviceability agent by
108 // the fact that it has a NULL fieldName
109 static VMStructEntry localHotSpotVMStructs[];
110 // The function to get localHotSpotVMStructs length
111 static size_t localHotSpotVMStructsLength();
112
113 // The last entry is identified over in the serviceability agent by
114 // the fact that it has a NULL typeName
115 static VMTypeEntry localHotSpotVMTypes[];
116 // The function to get localHotSpotVMTypes length
117 static size_t localHotSpotVMTypesLength();
118
119 // Table of integer constants required by the serviceability agent.
120 // The last entry is identified over in the serviceability agent by
121 // the fact that it has a NULL typeName
122 static VMIntConstantEntry localHotSpotVMIntConstants[];
123 // The function to get localHotSpotVMIntConstants length
124 static size_t localHotSpotVMIntConstantsLength();
125
126 // Table of long constants required by the serviceability agent.
127 // The last entry is identified over in the serviceability agent by
128 // the fact that it has a NULL typeName
129 static VMLongConstantEntry localHotSpotVMLongConstants[];
130 // The function to get localHotSpotVMIntConstants length
131 static size_t localHotSpotVMLongConstantsLength();
132
133 /**
134 * Table of addresses.
135 */
136 static VMAddressEntry localHotSpotVMAddresses[];
137
138 // This is used to run any checking code necessary for validation of
139 // the data structure (debug build only)
140 static void init();
141
142 #ifndef PRODUCT
143 // Execute unit tests
144 static void test();
145 #endif
146
147 private:
148 // Look up a type in localHotSpotVMTypes using strcmp() (debug build only).
149 // Returns 1 if found, 0 if not.
150 // debug_only(static int findType(const char* typeName);)
151 static int findType(const char* typeName);
|