1 /*
2 * Copyright (c) 1997, 2009, 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 *
23 */
24
25 // Interface for manipulating the basic Java classes.
26 //
27 // All dependencies on layout of actual Java classes should be kept here.
28 // If the layout of any of the classes above changes the offsets must be adjusted.
29 //
30 // For most classes we hardwire the offsets for performance reasons. In certain
31 // cases (e.g. java.security.AccessControlContext) we compute the offsets at
32 // startup since the layout here differs between JDK1.2 and JDK1.3.
33 //
34 // Note that fields (static and non-static) are arranged with oops before non-oops
35 // on a per class basis. The offsets below have to reflect this ordering.
36 //
37 // When editing the layouts please update the check_offset verification code
38 // correspondingly. The names in the enums must be identical to the actual field
39 // names in order for the verification code to work.
40
41
42 // Interface to java.lang.String objects
43
44 class java_lang_String : AllStatic {
1254 class java_util_concurrent_locks_AbstractOwnableSynchronizer : AllStatic {
1255 private:
1256 static int _owner_offset;
1257 public:
1258 static void initialize(TRAPS);
1259 static oop get_owner_threadObj(oop obj);
1260 };
1261
1262 // Interface to hard-coded offset checking
1263
1264 class JavaClasses : AllStatic {
1265 private:
1266 static bool check_offset(const char *klass_name, int offset, const char *field_name, const char* field_sig) PRODUCT_RETURN0;
1267 static bool check_static_offset(const char *klass_name, int hardcoded_offset, const char *field_name, const char* field_sig) PRODUCT_RETURN0;
1268 static bool check_constant(const char *klass_name, int constant, const char *field_name, const char* field_sig) PRODUCT_RETURN0;
1269 public:
1270 static void compute_hard_coded_offsets();
1271 static void compute_offsets();
1272 static void check_offsets() PRODUCT_RETURN;
1273 };
|
1 /*
2 * Copyright (c) 1997, 2010, 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 *
23 */
24
25 #ifndef SHARE_VM_CLASSFILE_JAVACLASSES_HPP
26 #define SHARE_VM_CLASSFILE_JAVACLASSES_HPP
27
28 #include "classfile/systemDictionary.hpp"
29 #include "jvmtifiles/jvmti.h"
30 #include "oops/oop.hpp"
31 #include "runtime/os.hpp"
32 #include "utilities/utf8.hpp"
33
34 // Interface for manipulating the basic Java classes.
35 //
36 // All dependencies on layout of actual Java classes should be kept here.
37 // If the layout of any of the classes above changes the offsets must be adjusted.
38 //
39 // For most classes we hardwire the offsets for performance reasons. In certain
40 // cases (e.g. java.security.AccessControlContext) we compute the offsets at
41 // startup since the layout here differs between JDK1.2 and JDK1.3.
42 //
43 // Note that fields (static and non-static) are arranged with oops before non-oops
44 // on a per class basis. The offsets below have to reflect this ordering.
45 //
46 // When editing the layouts please update the check_offset verification code
47 // correspondingly. The names in the enums must be identical to the actual field
48 // names in order for the verification code to work.
49
50
51 // Interface to java.lang.String objects
52
53 class java_lang_String : AllStatic {
1263 class java_util_concurrent_locks_AbstractOwnableSynchronizer : AllStatic {
1264 private:
1265 static int _owner_offset;
1266 public:
1267 static void initialize(TRAPS);
1268 static oop get_owner_threadObj(oop obj);
1269 };
1270
1271 // Interface to hard-coded offset checking
1272
1273 class JavaClasses : AllStatic {
1274 private:
1275 static bool check_offset(const char *klass_name, int offset, const char *field_name, const char* field_sig) PRODUCT_RETURN0;
1276 static bool check_static_offset(const char *klass_name, int hardcoded_offset, const char *field_name, const char* field_sig) PRODUCT_RETURN0;
1277 static bool check_constant(const char *klass_name, int constant, const char *field_name, const char* field_sig) PRODUCT_RETURN0;
1278 public:
1279 static void compute_hard_coded_offsets();
1280 static void compute_offsets();
1281 static void check_offsets() PRODUCT_RETURN;
1282 };
1283
1284 #endif // SHARE_VM_CLASSFILE_JAVACLASSES_HPP
|