2007-12-01 00:00:00 +00:00
|
|
|
/*
|
2015-02-13 14:37:35 +01:00
|
|
|
* Copyright (c) 1997, 2015, Oracle and/or its affiliates. All rights reserved.
|
2007-12-01 00:00:00 +00:00
|
|
|
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
|
|
|
|
*
|
|
|
|
* This code is free software; you can redistribute it and/or modify it
|
|
|
|
* under the terms of the GNU General Public License version 2 only, as
|
|
|
|
* published by the Free Software Foundation.
|
|
|
|
*
|
|
|
|
* This code is distributed in the hope that it will be useful, but WITHOUT
|
|
|
|
* ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
|
|
|
|
* FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
|
|
|
|
* version 2 for more details (a copy is included in the LICENSE file that
|
|
|
|
* accompanied this code).
|
|
|
|
*
|
|
|
|
* You should have received a copy of the GNU General Public License version
|
|
|
|
* 2 along with this work; if not, write to the Free Software Foundation,
|
|
|
|
* Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
|
|
|
|
*
|
2010-05-27 19:08:38 -07:00
|
|
|
* Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
|
|
|
|
* or visit www.oracle.com if you need additional information or have any
|
|
|
|
* questions.
|
2007-12-01 00:00:00 +00:00
|
|
|
*
|
|
|
|
*/
|
|
|
|
|
2010-11-23 13:22:55 -08:00
|
|
|
#ifndef SHARE_VM_CLASSFILE_JAVACLASSES_HPP
|
|
|
|
#define SHARE_VM_CLASSFILE_JAVACLASSES_HPP
|
|
|
|
|
|
|
|
#include "classfile/systemDictionary.hpp"
|
|
|
|
#include "jvmtifiles/jvmti.h"
|
|
|
|
#include "oops/oop.hpp"
|
|
|
|
#include "runtime/os.hpp"
|
|
|
|
#include "utilities/utf8.hpp"
|
|
|
|
|
2007-12-01 00:00:00 +00:00
|
|
|
// Interface for manipulating the basic Java classes.
|
|
|
|
//
|
|
|
|
// All dependencies on layout of actual Java classes should be kept here.
|
|
|
|
// If the layout of any of the classes above changes the offsets must be adjusted.
|
|
|
|
//
|
|
|
|
// For most classes we hardwire the offsets for performance reasons. In certain
|
|
|
|
// cases (e.g. java.security.AccessControlContext) we compute the offsets at
|
|
|
|
// startup since the layout here differs between JDK1.2 and JDK1.3.
|
|
|
|
//
|
|
|
|
// Note that fields (static and non-static) are arranged with oops before non-oops
|
|
|
|
// on a per class basis. The offsets below have to reflect this ordering.
|
|
|
|
//
|
|
|
|
// When editing the layouts please update the check_offset verification code
|
|
|
|
// correspondingly. The names in the enums must be identical to the actual field
|
|
|
|
// names in order for the verification code to work.
|
|
|
|
|
|
|
|
|
|
|
|
// Interface to java.lang.String objects
|
|
|
|
|
|
|
|
class java_lang_String : AllStatic {
|
|
|
|
private:
|
|
|
|
static int value_offset;
|
|
|
|
static int hash_offset;
|
8141132: JEP 254: Compact Strings
Adopt a more space-efficient internal representation for strings.
Co-authored-by: Brent Christian <brent.christian@oracle.com>
Co-authored-by: Vivek Deshpande <vivek.r.deshpande@intel.com>
Co-authored-by: Charlie Hunt <charlie.hunt@oracle.com>
Co-authored-by: Vladimir Kozlov <vladimir.kozlov@oracle.com>
Co-authored-by: Roger Riggs <roger.riggs@oracle.com>
Co-authored-by: Xueming Shen <xueming.shen@oracle.com>
Co-authored-by: Aleksey Shipilev <aleksey.shipilev@oracle.com>
Co-authored-by: Sandhya Viswanathan <sandhya.viswanathan@intel.com>
Reviewed-by: alanb, bdelsart, coleenp, iklam, jiangli, jrose, kevinw, naoto, pliden, roland, smarks, twisti
2015-11-03 09:41:03 +01:00
|
|
|
static int coder_offset;
|
2007-12-01 00:00:00 +00:00
|
|
|
|
2012-05-14 09:36:00 -07:00
|
|
|
static bool initialized;
|
|
|
|
|
8141132: JEP 254: Compact Strings
Adopt a more space-efficient internal representation for strings.
Co-authored-by: Brent Christian <brent.christian@oracle.com>
Co-authored-by: Vivek Deshpande <vivek.r.deshpande@intel.com>
Co-authored-by: Charlie Hunt <charlie.hunt@oracle.com>
Co-authored-by: Vladimir Kozlov <vladimir.kozlov@oracle.com>
Co-authored-by: Roger Riggs <roger.riggs@oracle.com>
Co-authored-by: Xueming Shen <xueming.shen@oracle.com>
Co-authored-by: Aleksey Shipilev <aleksey.shipilev@oracle.com>
Co-authored-by: Sandhya Viswanathan <sandhya.viswanathan@intel.com>
Reviewed-by: alanb, bdelsart, coleenp, iklam, jiangli, jrose, kevinw, naoto, pliden, roland, smarks, twisti
2015-11-03 09:41:03 +01:00
|
|
|
static Handle basic_create(int length, bool byte_arr, TRAPS);
|
2007-12-01 00:00:00 +00:00
|
|
|
|
8141132: JEP 254: Compact Strings
Adopt a more space-efficient internal representation for strings.
Co-authored-by: Brent Christian <brent.christian@oracle.com>
Co-authored-by: Vivek Deshpande <vivek.r.deshpande@intel.com>
Co-authored-by: Charlie Hunt <charlie.hunt@oracle.com>
Co-authored-by: Vladimir Kozlov <vladimir.kozlov@oracle.com>
Co-authored-by: Roger Riggs <roger.riggs@oracle.com>
Co-authored-by: Xueming Shen <xueming.shen@oracle.com>
Co-authored-by: Aleksey Shipilev <aleksey.shipilev@oracle.com>
Co-authored-by: Sandhya Viswanathan <sandhya.viswanathan@intel.com>
Reviewed-by: alanb, bdelsart, coleenp, iklam, jiangli, jrose, kevinw, naoto, pliden, roland, smarks, twisti
2015-11-03 09:41:03 +01:00
|
|
|
static void set_coder(oop string, jbyte coder) {
|
2012-05-14 09:36:00 -07:00
|
|
|
assert(initialized, "Must be initialized");
|
8141132: JEP 254: Compact Strings
Adopt a more space-efficient internal representation for strings.
Co-authored-by: Brent Christian <brent.christian@oracle.com>
Co-authored-by: Vivek Deshpande <vivek.r.deshpande@intel.com>
Co-authored-by: Charlie Hunt <charlie.hunt@oracle.com>
Co-authored-by: Vladimir Kozlov <vladimir.kozlov@oracle.com>
Co-authored-by: Roger Riggs <roger.riggs@oracle.com>
Co-authored-by: Xueming Shen <xueming.shen@oracle.com>
Co-authored-by: Aleksey Shipilev <aleksey.shipilev@oracle.com>
Co-authored-by: Sandhya Viswanathan <sandhya.viswanathan@intel.com>
Reviewed-by: alanb, bdelsart, coleenp, iklam, jiangli, jrose, kevinw, naoto, pliden, roland, smarks, twisti
2015-11-03 09:41:03 +01:00
|
|
|
if (coder_offset > 0) {
|
|
|
|
string->byte_field_put(coder_offset, coder);
|
2012-05-14 09:36:00 -07:00
|
|
|
}
|
|
|
|
}
|
2007-12-01 00:00:00 +00:00
|
|
|
|
|
|
|
public:
|
8141132: JEP 254: Compact Strings
Adopt a more space-efficient internal representation for strings.
Co-authored-by: Brent Christian <brent.christian@oracle.com>
Co-authored-by: Vivek Deshpande <vivek.r.deshpande@intel.com>
Co-authored-by: Charlie Hunt <charlie.hunt@oracle.com>
Co-authored-by: Vladimir Kozlov <vladimir.kozlov@oracle.com>
Co-authored-by: Roger Riggs <roger.riggs@oracle.com>
Co-authored-by: Xueming Shen <xueming.shen@oracle.com>
Co-authored-by: Aleksey Shipilev <aleksey.shipilev@oracle.com>
Co-authored-by: Sandhya Viswanathan <sandhya.viswanathan@intel.com>
Reviewed-by: alanb, bdelsart, coleenp, iklam, jiangli, jrose, kevinw, naoto, pliden, roland, smarks, twisti
2015-11-03 09:41:03 +01:00
|
|
|
|
|
|
|
// Coders
|
|
|
|
enum Coder {
|
|
|
|
CODER_LATIN1 = 0,
|
|
|
|
CODER_UTF16 = 1
|
|
|
|
};
|
|
|
|
|
2012-05-14 09:36:00 -07:00
|
|
|
static void compute_offsets();
|
|
|
|
|
2007-12-01 00:00:00 +00:00
|
|
|
// Instance creation
|
|
|
|
static Handle create_from_unicode(jchar* unicode, int len, TRAPS);
|
|
|
|
static oop create_oop_from_unicode(jchar* unicode, int len, TRAPS);
|
|
|
|
static Handle create_from_str(const char* utf8_str, TRAPS);
|
|
|
|
static oop create_oop_from_str(const char* utf8_str, TRAPS);
|
2011-01-27 16:11:27 -08:00
|
|
|
static Handle create_from_symbol(Symbol* symbol, TRAPS);
|
2007-12-01 00:00:00 +00:00
|
|
|
static Handle create_from_platform_dependent_str(const char* str, TRAPS);
|
|
|
|
static Handle char_converter(Handle java_string, jchar from_char, jchar to_char, TRAPS);
|
|
|
|
|
8141132: JEP 254: Compact Strings
Adopt a more space-efficient internal representation for strings.
Co-authored-by: Brent Christian <brent.christian@oracle.com>
Co-authored-by: Vivek Deshpande <vivek.r.deshpande@intel.com>
Co-authored-by: Charlie Hunt <charlie.hunt@oracle.com>
Co-authored-by: Vladimir Kozlov <vladimir.kozlov@oracle.com>
Co-authored-by: Roger Riggs <roger.riggs@oracle.com>
Co-authored-by: Xueming Shen <xueming.shen@oracle.com>
Co-authored-by: Aleksey Shipilev <aleksey.shipilev@oracle.com>
Co-authored-by: Sandhya Viswanathan <sandhya.viswanathan@intel.com>
Reviewed-by: alanb, bdelsart, coleenp, iklam, jiangli, jrose, kevinw, naoto, pliden, roland, smarks, twisti
2015-11-03 09:41:03 +01:00
|
|
|
static bool has_hash_field() {
|
2012-05-14 09:36:00 -07:00
|
|
|
assert(initialized, "Must be initialized");
|
8141132: JEP 254: Compact Strings
Adopt a more space-efficient internal representation for strings.
Co-authored-by: Brent Christian <brent.christian@oracle.com>
Co-authored-by: Vivek Deshpande <vivek.r.deshpande@intel.com>
Co-authored-by: Charlie Hunt <charlie.hunt@oracle.com>
Co-authored-by: Vladimir Kozlov <vladimir.kozlov@oracle.com>
Co-authored-by: Roger Riggs <roger.riggs@oracle.com>
Co-authored-by: Xueming Shen <xueming.shen@oracle.com>
Co-authored-by: Aleksey Shipilev <aleksey.shipilev@oracle.com>
Co-authored-by: Sandhya Viswanathan <sandhya.viswanathan@intel.com>
Reviewed-by: alanb, bdelsart, coleenp, iklam, jiangli, jrose, kevinw, naoto, pliden, roland, smarks, twisti
2015-11-03 09:41:03 +01:00
|
|
|
return (hash_offset > 0);
|
2012-05-14 09:36:00 -07:00
|
|
|
}
|
8141132: JEP 254: Compact Strings
Adopt a more space-efficient internal representation for strings.
Co-authored-by: Brent Christian <brent.christian@oracle.com>
Co-authored-by: Vivek Deshpande <vivek.r.deshpande@intel.com>
Co-authored-by: Charlie Hunt <charlie.hunt@oracle.com>
Co-authored-by: Vladimir Kozlov <vladimir.kozlov@oracle.com>
Co-authored-by: Roger Riggs <roger.riggs@oracle.com>
Co-authored-by: Xueming Shen <xueming.shen@oracle.com>
Co-authored-by: Aleksey Shipilev <aleksey.shipilev@oracle.com>
Co-authored-by: Sandhya Viswanathan <sandhya.viswanathan@intel.com>
Reviewed-by: alanb, bdelsart, coleenp, iklam, jiangli, jrose, kevinw, naoto, pliden, roland, smarks, twisti
2015-11-03 09:41:03 +01:00
|
|
|
static bool has_coder_field() {
|
2012-05-14 09:36:00 -07:00
|
|
|
assert(initialized, "Must be initialized");
|
8141132: JEP 254: Compact Strings
Adopt a more space-efficient internal representation for strings.
Co-authored-by: Brent Christian <brent.christian@oracle.com>
Co-authored-by: Vivek Deshpande <vivek.r.deshpande@intel.com>
Co-authored-by: Charlie Hunt <charlie.hunt@oracle.com>
Co-authored-by: Vladimir Kozlov <vladimir.kozlov@oracle.com>
Co-authored-by: Roger Riggs <roger.riggs@oracle.com>
Co-authored-by: Xueming Shen <xueming.shen@oracle.com>
Co-authored-by: Aleksey Shipilev <aleksey.shipilev@oracle.com>
Co-authored-by: Sandhya Viswanathan <sandhya.viswanathan@intel.com>
Reviewed-by: alanb, bdelsart, coleenp, iklam, jiangli, jrose, kevinw, naoto, pliden, roland, smarks, twisti
2015-11-03 09:41:03 +01:00
|
|
|
return (coder_offset > 0);
|
2012-05-14 09:36:00 -07:00
|
|
|
}
|
|
|
|
|
8141132: JEP 254: Compact Strings
Adopt a more space-efficient internal representation for strings.
Co-authored-by: Brent Christian <brent.christian@oracle.com>
Co-authored-by: Vivek Deshpande <vivek.r.deshpande@intel.com>
Co-authored-by: Charlie Hunt <charlie.hunt@oracle.com>
Co-authored-by: Vladimir Kozlov <vladimir.kozlov@oracle.com>
Co-authored-by: Roger Riggs <roger.riggs@oracle.com>
Co-authored-by: Xueming Shen <xueming.shen@oracle.com>
Co-authored-by: Aleksey Shipilev <aleksey.shipilev@oracle.com>
Co-authored-by: Sandhya Viswanathan <sandhya.viswanathan@intel.com>
Reviewed-by: alanb, bdelsart, coleenp, iklam, jiangli, jrose, kevinw, naoto, pliden, roland, smarks, twisti
2015-11-03 09:41:03 +01:00
|
|
|
static void set_compact_strings(bool value);
|
2012-05-14 09:36:00 -07:00
|
|
|
|
|
|
|
static int value_offset_in_bytes() {
|
|
|
|
assert(initialized && (value_offset > 0), "Must be initialized");
|
|
|
|
return value_offset;
|
|
|
|
}
|
|
|
|
static int hash_offset_in_bytes() {
|
|
|
|
assert(initialized && (hash_offset > 0), "Must be initialized");
|
|
|
|
return hash_offset;
|
|
|
|
}
|
8141132: JEP 254: Compact Strings
Adopt a more space-efficient internal representation for strings.
Co-authored-by: Brent Christian <brent.christian@oracle.com>
Co-authored-by: Vivek Deshpande <vivek.r.deshpande@intel.com>
Co-authored-by: Charlie Hunt <charlie.hunt@oracle.com>
Co-authored-by: Vladimir Kozlov <vladimir.kozlov@oracle.com>
Co-authored-by: Roger Riggs <roger.riggs@oracle.com>
Co-authored-by: Xueming Shen <xueming.shen@oracle.com>
Co-authored-by: Aleksey Shipilev <aleksey.shipilev@oracle.com>
Co-authored-by: Sandhya Viswanathan <sandhya.viswanathan@intel.com>
Reviewed-by: alanb, bdelsart, coleenp, iklam, jiangli, jrose, kevinw, naoto, pliden, roland, smarks, twisti
2015-11-03 09:41:03 +01:00
|
|
|
static int coder_offset_in_bytes() {
|
|
|
|
assert(initialized && (coder_offset > 0), "Must be initialized");
|
|
|
|
return coder_offset;
|
|
|
|
}
|
2007-12-01 00:00:00 +00:00
|
|
|
|
2015-06-12 17:29:14 -04:00
|
|
|
static void set_value_raw(oop string, typeArrayOop buffer) {
|
|
|
|
assert(initialized, "Must be initialized");
|
|
|
|
string->obj_field_put_raw(value_offset, buffer);
|
|
|
|
}
|
2014-03-18 19:07:22 +01:00
|
|
|
static void set_value(oop string, typeArrayOop buffer) {
|
|
|
|
assert(initialized && (value_offset > 0), "Must be initialized");
|
|
|
|
string->obj_field_put(value_offset, (oop)buffer);
|
|
|
|
}
|
|
|
|
static void set_hash(oop string, unsigned int hash) {
|
|
|
|
assert(initialized && (hash_offset > 0), "Must be initialized");
|
|
|
|
string->int_field_put(hash_offset, hash);
|
|
|
|
}
|
|
|
|
|
2007-12-01 00:00:00 +00:00
|
|
|
// Accessors
|
|
|
|
static typeArrayOop value(oop java_string) {
|
2012-05-14 09:36:00 -07:00
|
|
|
assert(initialized && (value_offset > 0), "Must be initialized");
|
2007-12-01 00:00:00 +00:00
|
|
|
assert(is_instance(java_string), "must be java_string");
|
|
|
|
return (typeArrayOop) java_string->obj_field(value_offset);
|
|
|
|
}
|
2014-03-18 19:07:22 +01:00
|
|
|
static unsigned int hash(oop java_string) {
|
|
|
|
assert(initialized && (hash_offset > 0), "Must be initialized");
|
|
|
|
assert(is_instance(java_string), "must be java_string");
|
|
|
|
return java_string->int_field(hash_offset);
|
|
|
|
}
|
8141132: JEP 254: Compact Strings
Adopt a more space-efficient internal representation for strings.
Co-authored-by: Brent Christian <brent.christian@oracle.com>
Co-authored-by: Vivek Deshpande <vivek.r.deshpande@intel.com>
Co-authored-by: Charlie Hunt <charlie.hunt@oracle.com>
Co-authored-by: Vladimir Kozlov <vladimir.kozlov@oracle.com>
Co-authored-by: Roger Riggs <roger.riggs@oracle.com>
Co-authored-by: Xueming Shen <xueming.shen@oracle.com>
Co-authored-by: Aleksey Shipilev <aleksey.shipilev@oracle.com>
Co-authored-by: Sandhya Viswanathan <sandhya.viswanathan@intel.com>
Reviewed-by: alanb, bdelsart, coleenp, iklam, jiangli, jrose, kevinw, naoto, pliden, roland, smarks, twisti
2015-11-03 09:41:03 +01:00
|
|
|
static bool is_latin1(oop java_string) {
|
2012-05-14 09:36:00 -07:00
|
|
|
assert(initialized, "Must be initialized");
|
2007-12-01 00:00:00 +00:00
|
|
|
assert(is_instance(java_string), "must be java_string");
|
8141132: JEP 254: Compact Strings
Adopt a more space-efficient internal representation for strings.
Co-authored-by: Brent Christian <brent.christian@oracle.com>
Co-authored-by: Vivek Deshpande <vivek.r.deshpande@intel.com>
Co-authored-by: Charlie Hunt <charlie.hunt@oracle.com>
Co-authored-by: Vladimir Kozlov <vladimir.kozlov@oracle.com>
Co-authored-by: Roger Riggs <roger.riggs@oracle.com>
Co-authored-by: Xueming Shen <xueming.shen@oracle.com>
Co-authored-by: Aleksey Shipilev <aleksey.shipilev@oracle.com>
Co-authored-by: Sandhya Viswanathan <sandhya.viswanathan@intel.com>
Reviewed-by: alanb, bdelsart, coleenp, iklam, jiangli, jrose, kevinw, naoto, pliden, roland, smarks, twisti
2015-11-03 09:41:03 +01:00
|
|
|
if (coder_offset > 0) {
|
|
|
|
jbyte coder = java_string->byte_field(coder_offset);
|
|
|
|
assert(CompactStrings || coder == CODER_UTF16, "Must be UTF16 without CompactStrings");
|
|
|
|
return coder == CODER_LATIN1;
|
2012-05-14 09:36:00 -07:00
|
|
|
} else {
|
8141132: JEP 254: Compact Strings
Adopt a more space-efficient internal representation for strings.
Co-authored-by: Brent Christian <brent.christian@oracle.com>
Co-authored-by: Vivek Deshpande <vivek.r.deshpande@intel.com>
Co-authored-by: Charlie Hunt <charlie.hunt@oracle.com>
Co-authored-by: Vladimir Kozlov <vladimir.kozlov@oracle.com>
Co-authored-by: Roger Riggs <roger.riggs@oracle.com>
Co-authored-by: Xueming Shen <xueming.shen@oracle.com>
Co-authored-by: Aleksey Shipilev <aleksey.shipilev@oracle.com>
Co-authored-by: Sandhya Viswanathan <sandhya.viswanathan@intel.com>
Reviewed-by: alanb, bdelsart, coleenp, iklam, jiangli, jrose, kevinw, naoto, pliden, roland, smarks, twisti
2015-11-03 09:41:03 +01:00
|
|
|
return false;
|
2012-05-14 09:36:00 -07:00
|
|
|
}
|
2007-12-01 00:00:00 +00:00
|
|
|
}
|
|
|
|
static int length(oop java_string) {
|
2012-05-14 09:36:00 -07:00
|
|
|
assert(initialized, "Must be initialized");
|
2007-12-01 00:00:00 +00:00
|
|
|
assert(is_instance(java_string), "must be java_string");
|
8141132: JEP 254: Compact Strings
Adopt a more space-efficient internal representation for strings.
Co-authored-by: Brent Christian <brent.christian@oracle.com>
Co-authored-by: Vivek Deshpande <vivek.r.deshpande@intel.com>
Co-authored-by: Charlie Hunt <charlie.hunt@oracle.com>
Co-authored-by: Vladimir Kozlov <vladimir.kozlov@oracle.com>
Co-authored-by: Roger Riggs <roger.riggs@oracle.com>
Co-authored-by: Xueming Shen <xueming.shen@oracle.com>
Co-authored-by: Aleksey Shipilev <aleksey.shipilev@oracle.com>
Co-authored-by: Sandhya Viswanathan <sandhya.viswanathan@intel.com>
Reviewed-by: alanb, bdelsart, coleenp, iklam, jiangli, jrose, kevinw, naoto, pliden, roland, smarks, twisti
2015-11-03 09:41:03 +01:00
|
|
|
typeArrayOop value_array = ((typeArrayOop)java_string->obj_field(value_offset));
|
|
|
|
if (value_array == NULL) {
|
|
|
|
return 0;
|
2012-05-14 09:36:00 -07:00
|
|
|
}
|
8141132: JEP 254: Compact Strings
Adopt a more space-efficient internal representation for strings.
Co-authored-by: Brent Christian <brent.christian@oracle.com>
Co-authored-by: Vivek Deshpande <vivek.r.deshpande@intel.com>
Co-authored-by: Charlie Hunt <charlie.hunt@oracle.com>
Co-authored-by: Vladimir Kozlov <vladimir.kozlov@oracle.com>
Co-authored-by: Roger Riggs <roger.riggs@oracle.com>
Co-authored-by: Xueming Shen <xueming.shen@oracle.com>
Co-authored-by: Aleksey Shipilev <aleksey.shipilev@oracle.com>
Co-authored-by: Sandhya Viswanathan <sandhya.viswanathan@intel.com>
Reviewed-by: alanb, bdelsart, coleenp, iklam, jiangli, jrose, kevinw, naoto, pliden, roland, smarks, twisti
2015-11-03 09:41:03 +01:00
|
|
|
int arr_length = value_array->length();
|
|
|
|
if (!is_latin1(java_string)) {
|
|
|
|
assert((arr_length & 1) == 0, "should be even for UTF16 string");
|
|
|
|
arr_length >>= 1; // convert number of bytes to number of elements
|
|
|
|
}
|
|
|
|
return arr_length;
|
2007-12-01 00:00:00 +00:00
|
|
|
}
|
|
|
|
static int utf8_length(oop java_string);
|
|
|
|
|
|
|
|
// String converters
|
|
|
|
static char* as_utf8_string(oop java_string);
|
2010-12-07 03:15:45 -08:00
|
|
|
static char* as_utf8_string(oop java_string, char* buf, int buflen);
|
2007-12-01 00:00:00 +00:00
|
|
|
static char* as_utf8_string(oop java_string, int start, int len);
|
2014-04-03 14:54:42 +02:00
|
|
|
static char* as_utf8_string(oop java_string, int start, int len, char* buf, int buflen);
|
2008-01-17 13:38:17 -08:00
|
|
|
static char* as_platform_dependent_str(Handle java_string, TRAPS);
|
2013-04-29 16:13:57 -04:00
|
|
|
static jchar* as_unicode_string(oop java_string, int& length, TRAPS);
|
2012-11-12 14:03:53 -08:00
|
|
|
// produce an ascii string with all other values quoted using \u####
|
|
|
|
static char* as_quoted_ascii(oop java_string);
|
2007-12-01 00:00:00 +00:00
|
|
|
|
2011-03-31 14:00:41 -07:00
|
|
|
// Compute the hash value for a java.lang.String object which would
|
2012-06-13 19:52:59 -04:00
|
|
|
// contain the characters passed in.
|
2011-03-31 14:00:41 -07:00
|
|
|
//
|
2012-06-13 19:52:59 -04:00
|
|
|
// As the hash value used by the String object itself, in
|
|
|
|
// String.hashCode(). This value is normally calculated in Java code
|
|
|
|
// in the String.hashCode method(), but is precomputed for String
|
|
|
|
// objects in the shared archive file.
|
|
|
|
// hash P(31) from Kernighan & Ritchie
|
2011-03-31 14:00:41 -07:00
|
|
|
//
|
2012-12-13 10:09:49 +01:00
|
|
|
// For this reason, THIS ALGORITHM MUST MATCH String.hashCode().
|
8141132: JEP 254: Compact Strings
Adopt a more space-efficient internal representation for strings.
Co-authored-by: Brent Christian <brent.christian@oracle.com>
Co-authored-by: Vivek Deshpande <vivek.r.deshpande@intel.com>
Co-authored-by: Charlie Hunt <charlie.hunt@oracle.com>
Co-authored-by: Vladimir Kozlov <vladimir.kozlov@oracle.com>
Co-authored-by: Roger Riggs <roger.riggs@oracle.com>
Co-authored-by: Xueming Shen <xueming.shen@oracle.com>
Co-authored-by: Aleksey Shipilev <aleksey.shipilev@oracle.com>
Co-authored-by: Sandhya Viswanathan <sandhya.viswanathan@intel.com>
Reviewed-by: alanb, bdelsart, coleenp, iklam, jiangli, jrose, kevinw, naoto, pliden, roland, smarks, twisti
2015-11-03 09:41:03 +01:00
|
|
|
static unsigned int hash_code(const jchar* s, int len) {
|
2011-03-31 14:00:41 -07:00
|
|
|
unsigned int h = 0;
|
|
|
|
while (len-- > 0) {
|
|
|
|
h = 31*h + (unsigned int) *s;
|
|
|
|
s++;
|
|
|
|
}
|
|
|
|
return h;
|
|
|
|
}
|
8141132: JEP 254: Compact Strings
Adopt a more space-efficient internal representation for strings.
Co-authored-by: Brent Christian <brent.christian@oracle.com>
Co-authored-by: Vivek Deshpande <vivek.r.deshpande@intel.com>
Co-authored-by: Charlie Hunt <charlie.hunt@oracle.com>
Co-authored-by: Vladimir Kozlov <vladimir.kozlov@oracle.com>
Co-authored-by: Roger Riggs <roger.riggs@oracle.com>
Co-authored-by: Xueming Shen <xueming.shen@oracle.com>
Co-authored-by: Aleksey Shipilev <aleksey.shipilev@oracle.com>
Co-authored-by: Sandhya Viswanathan <sandhya.viswanathan@intel.com>
Reviewed-by: alanb, bdelsart, coleenp, iklam, jiangli, jrose, kevinw, naoto, pliden, roland, smarks, twisti
2015-11-03 09:41:03 +01:00
|
|
|
|
|
|
|
static unsigned int hash_code(const jbyte* s, int len) {
|
|
|
|
unsigned int h = 0;
|
|
|
|
while (len-- > 0) {
|
|
|
|
h = 31*h + (((unsigned int) *s) & 0xFF);
|
|
|
|
s++;
|
|
|
|
}
|
|
|
|
return h;
|
|
|
|
}
|
|
|
|
|
2012-12-13 10:09:49 +01:00
|
|
|
static unsigned int hash_code(oop java_string);
|
8141132: JEP 254: Compact Strings
Adopt a more space-efficient internal representation for strings.
Co-authored-by: Brent Christian <brent.christian@oracle.com>
Co-authored-by: Vivek Deshpande <vivek.r.deshpande@intel.com>
Co-authored-by: Charlie Hunt <charlie.hunt@oracle.com>
Co-authored-by: Vladimir Kozlov <vladimir.kozlov@oracle.com>
Co-authored-by: Roger Riggs <roger.riggs@oracle.com>
Co-authored-by: Xueming Shen <xueming.shen@oracle.com>
Co-authored-by: Aleksey Shipilev <aleksey.shipilev@oracle.com>
Co-authored-by: Sandhya Viswanathan <sandhya.viswanathan@intel.com>
Reviewed-by: alanb, bdelsart, coleenp, iklam, jiangli, jrose, kevinw, naoto, pliden, roland, smarks, twisti
2015-11-03 09:41:03 +01:00
|
|
|
static unsigned int latin1_hash_code(typeArrayOop value, int len);
|
2012-06-13 19:52:59 -04:00
|
|
|
|
|
|
|
// This is the string hash code used by the StringTable, which may be
|
2012-12-13 10:09:49 +01:00
|
|
|
// the same as String.hashCode or an alternate hash code.
|
2011-03-31 14:00:41 -07:00
|
|
|
static unsigned int hash_string(oop java_string);
|
|
|
|
|
2007-12-01 00:00:00 +00:00
|
|
|
static bool equals(oop java_string, jchar* chars, int len);
|
2013-09-18 07:02:10 -07:00
|
|
|
static bool equals(oop str1, oop str2);
|
2007-12-01 00:00:00 +00:00
|
|
|
|
|
|
|
// Conversion between '.' and '/' formats
|
|
|
|
static Handle externalize_classname(Handle java_string, TRAPS) { return char_converter(java_string, '/', '.', THREAD); }
|
|
|
|
static Handle internalize_classname(Handle java_string, TRAPS) { return char_converter(java_string, '.', '/', THREAD); }
|
|
|
|
|
|
|
|
// Conversion
|
2011-01-27 16:11:27 -08:00
|
|
|
static Symbol* as_symbol(Handle java_string, TRAPS);
|
|
|
|
static Symbol* as_symbol_or_null(oop java_string);
|
2007-12-01 00:00:00 +00:00
|
|
|
|
|
|
|
// Testers
|
2015-02-13 14:37:35 +01:00
|
|
|
static bool is_instance(oop obj);
|
|
|
|
static bool is_instance_inlined(oop obj);
|
2007-12-01 00:00:00 +00:00
|
|
|
|
|
|
|
// Debugging
|
2014-02-27 10:34:55 +01:00
|
|
|
static void print(oop java_string, outputStream* st);
|
2007-12-01 00:00:00 +00:00
|
|
|
friend class JavaClasses;
|
2015-06-12 17:29:14 -04:00
|
|
|
friend class StringTable;
|
2007-12-01 00:00:00 +00:00
|
|
|
};
|
|
|
|
|
|
|
|
|
|
|
|
// Interface to java.lang.Class objects
|
|
|
|
|
2011-09-10 17:29:02 -07:00
|
|
|
#define CLASS_INJECTED_FIELDS(macro) \
|
6964458: Reimplement class meta-data storage to use native memory
Remove PermGen, allocate meta-data in metaspace linked to class loaders, rewrite GC walking, rewrite and rename metadata to be C++ classes
Co-authored-by: Stefan Karlsson <stefan.karlsson@oracle.com>
Co-authored-by: Mikael Gerdin <mikael.gerdin@oracle.com>
Co-authored-by: Tom Rodriguez <tom.rodriguez@oracle.com>
Reviewed-by: jmasa, stefank, never, coleenp, kvn, brutisso, mgerdin, dholmes, jrose, twisti, roland
2012-09-01 13:25:18 -04:00
|
|
|
macro(java_lang_Class, klass, intptr_signature, false) \
|
|
|
|
macro(java_lang_Class, array_klass, intptr_signature, false) \
|
2011-09-10 17:29:02 -07:00
|
|
|
macro(java_lang_Class, oop_size, int_signature, false) \
|
2013-05-22 14:37:49 -04:00
|
|
|
macro(java_lang_Class, static_oop_field_count, int_signature, false) \
|
|
|
|
macro(java_lang_Class, protection_domain, object_signature, false) \
|
|
|
|
macro(java_lang_Class, signers, object_signature, false)
|
2011-09-10 17:29:02 -07:00
|
|
|
|
2007-12-01 00:00:00 +00:00
|
|
|
class java_lang_Class : AllStatic {
|
2011-09-10 17:29:02 -07:00
|
|
|
friend class VMStructs;
|
|
|
|
|
2007-12-01 00:00:00 +00:00
|
|
|
private:
|
|
|
|
// The fake offsets are added by the class loader when java.lang.Class is loaded
|
|
|
|
|
2011-09-10 17:29:02 -07:00
|
|
|
static int _klass_offset;
|
|
|
|
static int _array_klass_offset;
|
2007-12-01 00:00:00 +00:00
|
|
|
|
2011-09-10 17:29:02 -07:00
|
|
|
static int _oop_size_offset;
|
|
|
|
static int _static_oop_field_count_offset;
|
2011-03-18 16:00:34 -07:00
|
|
|
|
2013-05-22 14:37:49 -04:00
|
|
|
static int _protection_domain_offset;
|
|
|
|
static int _init_lock_offset;
|
|
|
|
static int _signers_offset;
|
2014-06-19 14:49:33 -04:00
|
|
|
static int _class_loader_offset;
|
2014-07-02 15:22:18 -04:00
|
|
|
static int _component_mirror_offset;
|
2013-05-22 14:37:49 -04:00
|
|
|
|
2007-12-01 00:00:00 +00:00
|
|
|
static bool offsets_computed;
|
|
|
|
static int classRedefinedCount_offset;
|
2014-06-19 14:49:33 -04:00
|
|
|
|
6964458: Reimplement class meta-data storage to use native memory
Remove PermGen, allocate meta-data in metaspace linked to class loaders, rewrite GC walking, rewrite and rename metadata to be C++ classes
Co-authored-by: Stefan Karlsson <stefan.karlsson@oracle.com>
Co-authored-by: Mikael Gerdin <mikael.gerdin@oracle.com>
Co-authored-by: Tom Rodriguez <tom.rodriguez@oracle.com>
Reviewed-by: jmasa, stefank, never, coleenp, kvn, brutisso, mgerdin, dholmes, jrose, twisti, roland
2012-09-01 13:25:18 -04:00
|
|
|
static GrowableArray<Klass*>* _fixup_mirror_list;
|
2007-12-01 00:00:00 +00:00
|
|
|
|
2013-05-22 14:37:49 -04:00
|
|
|
static void set_init_lock(oop java_class, oop init_lock);
|
2013-07-08 19:36:22 -04:00
|
|
|
static void set_protection_domain(oop java_class, oop protection_domain);
|
2014-06-19 14:49:33 -04:00
|
|
|
static void set_class_loader(oop java_class, oop class_loader);
|
2014-07-02 15:22:18 -04:00
|
|
|
static void set_component_mirror(oop java_class, oop comp_mirror);
|
2014-04-08 13:58:38 -04:00
|
|
|
static void initialize_mirror_fields(KlassHandle k, Handle mirror, Handle protection_domain, TRAPS);
|
2007-12-01 00:00:00 +00:00
|
|
|
public:
|
2011-09-10 17:29:02 -07:00
|
|
|
static void compute_offsets();
|
|
|
|
|
2007-12-01 00:00:00 +00:00
|
|
|
// Instance creation
|
2014-06-19 14:49:33 -04:00
|
|
|
static void create_mirror(KlassHandle k, Handle class_loader,
|
|
|
|
Handle protection_domain, TRAPS);
|
2011-03-18 16:00:34 -07:00
|
|
|
static void fixup_mirror(KlassHandle k, TRAPS);
|
2007-12-01 00:00:00 +00:00
|
|
|
static oop create_basic_type_mirror(const char* basic_type_name, BasicType type, TRAPS);
|
|
|
|
// Conversion
|
6964458: Reimplement class meta-data storage to use native memory
Remove PermGen, allocate meta-data in metaspace linked to class loaders, rewrite GC walking, rewrite and rename metadata to be C++ classes
Co-authored-by: Stefan Karlsson <stefan.karlsson@oracle.com>
Co-authored-by: Mikael Gerdin <mikael.gerdin@oracle.com>
Co-authored-by: Tom Rodriguez <tom.rodriguez@oracle.com>
Reviewed-by: jmasa, stefank, never, coleenp, kvn, brutisso, mgerdin, dholmes, jrose, twisti, roland
2012-09-01 13:25:18 -04:00
|
|
|
static Klass* as_Klass(oop java_class);
|
|
|
|
static void set_klass(oop java_class, Klass* klass);
|
|
|
|
static BasicType as_BasicType(oop java_class, Klass** reference_klass = NULL);
|
2009-04-08 10:56:49 -07:00
|
|
|
static BasicType as_BasicType(oop java_class, KlassHandle* reference_klass) {
|
6964458: Reimplement class meta-data storage to use native memory
Remove PermGen, allocate meta-data in metaspace linked to class loaders, rewrite GC walking, rewrite and rename metadata to be C++ classes
Co-authored-by: Stefan Karlsson <stefan.karlsson@oracle.com>
Co-authored-by: Mikael Gerdin <mikael.gerdin@oracle.com>
Co-authored-by: Tom Rodriguez <tom.rodriguez@oracle.com>
Reviewed-by: jmasa, stefank, never, coleenp, kvn, brutisso, mgerdin, dholmes, jrose, twisti, roland
2012-09-01 13:25:18 -04:00
|
|
|
Klass* refk_oop = NULL;
|
2009-04-08 10:56:49 -07:00
|
|
|
BasicType result = as_BasicType(java_class, &refk_oop);
|
|
|
|
(*reference_klass) = KlassHandle(refk_oop);
|
|
|
|
return result;
|
|
|
|
}
|
2011-01-27 16:11:27 -08:00
|
|
|
static Symbol* as_signature(oop java_class, bool intern_if_not_found, TRAPS);
|
2009-03-20 23:19:36 -07:00
|
|
|
static void print_signature(oop java_class, outputStream *st);
|
2015-07-20 18:57:07 +03:00
|
|
|
static const char* as_external_name(oop java_class);
|
2007-12-01 00:00:00 +00:00
|
|
|
// Testing
|
2015-02-13 14:37:35 +01:00
|
|
|
static bool is_instance(oop obj);
|
|
|
|
|
2007-12-01 00:00:00 +00:00
|
|
|
static bool is_primitive(oop java_class);
|
|
|
|
static BasicType primitive_type(oop java_class);
|
|
|
|
static oop primitive_mirror(BasicType t);
|
|
|
|
// JVM_NewArray support
|
6964458: Reimplement class meta-data storage to use native memory
Remove PermGen, allocate meta-data in metaspace linked to class loaders, rewrite GC walking, rewrite and rename metadata to be C++ classes
Co-authored-by: Stefan Karlsson <stefan.karlsson@oracle.com>
Co-authored-by: Mikael Gerdin <mikael.gerdin@oracle.com>
Co-authored-by: Tom Rodriguez <tom.rodriguez@oracle.com>
Reviewed-by: jmasa, stefank, never, coleenp, kvn, brutisso, mgerdin, dholmes, jrose, twisti, roland
2012-09-01 13:25:18 -04:00
|
|
|
static Klass* array_klass(oop java_class);
|
|
|
|
static void set_array_klass(oop java_class, Klass* klass);
|
2007-12-01 00:00:00 +00:00
|
|
|
// compiler support for class operations
|
2011-09-10 17:29:02 -07:00
|
|
|
static int klass_offset_in_bytes() { return _klass_offset; }
|
|
|
|
static int array_klass_offset_in_bytes() { return _array_klass_offset; }
|
2007-12-01 00:00:00 +00:00
|
|
|
// Support for classRedefinedCount field
|
|
|
|
static int classRedefinedCount(oop the_class_mirror);
|
|
|
|
static void set_classRedefinedCount(oop the_class_mirror, int value);
|
2011-03-18 16:00:34 -07:00
|
|
|
|
2013-05-22 14:37:49 -04:00
|
|
|
// Support for embedded per-class oops
|
|
|
|
static oop protection_domain(oop java_class);
|
|
|
|
static oop init_lock(oop java_class);
|
2014-07-02 15:22:18 -04:00
|
|
|
static oop component_mirror(oop java_class);
|
2013-05-22 14:37:49 -04:00
|
|
|
static objArrayOop signers(oop java_class);
|
|
|
|
static void set_signers(oop java_class, objArrayOop signers);
|
|
|
|
|
2014-06-19 14:49:33 -04:00
|
|
|
static oop class_loader(oop java_class);
|
|
|
|
|
2011-03-18 16:00:34 -07:00
|
|
|
static int oop_size(oop java_class);
|
|
|
|
static void set_oop_size(oop java_class, int size);
|
|
|
|
static int static_oop_field_count(oop java_class);
|
|
|
|
static void set_static_oop_field_count(oop java_class, int size);
|
|
|
|
|
6964458: Reimplement class meta-data storage to use native memory
Remove PermGen, allocate meta-data in metaspace linked to class loaders, rewrite GC walking, rewrite and rename metadata to be C++ classes
Co-authored-by: Stefan Karlsson <stefan.karlsson@oracle.com>
Co-authored-by: Mikael Gerdin <mikael.gerdin@oracle.com>
Co-authored-by: Tom Rodriguez <tom.rodriguez@oracle.com>
Reviewed-by: jmasa, stefank, never, coleenp, kvn, brutisso, mgerdin, dholmes, jrose, twisti, roland
2012-09-01 13:25:18 -04:00
|
|
|
static GrowableArray<Klass*>* fixup_mirror_list() {
|
|
|
|
return _fixup_mirror_list;
|
|
|
|
}
|
|
|
|
static void set_fixup_mirror_list(GrowableArray<Klass*>* v) {
|
|
|
|
_fixup_mirror_list = v;
|
|
|
|
}
|
2007-12-01 00:00:00 +00:00
|
|
|
// Debugging
|
|
|
|
friend class JavaClasses;
|
6964458: Reimplement class meta-data storage to use native memory
Remove PermGen, allocate meta-data in metaspace linked to class loaders, rewrite GC walking, rewrite and rename metadata to be C++ classes
Co-authored-by: Stefan Karlsson <stefan.karlsson@oracle.com>
Co-authored-by: Mikael Gerdin <mikael.gerdin@oracle.com>
Co-authored-by: Tom Rodriguez <tom.rodriguez@oracle.com>
Reviewed-by: jmasa, stefank, never, coleenp, kvn, brutisso, mgerdin, dholmes, jrose, twisti, roland
2012-09-01 13:25:18 -04:00
|
|
|
friend class InstanceKlass; // verification code accesses offsets
|
2007-12-01 00:00:00 +00:00
|
|
|
friend class ClassFileParser; // access to number_of_fake_fields
|
|
|
|
};
|
|
|
|
|
|
|
|
// Interface to java.lang.Thread objects
|
|
|
|
|
|
|
|
class java_lang_Thread : AllStatic {
|
|
|
|
private:
|
|
|
|
// Note that for this class the layout changed between JDK1.2 and JDK1.3,
|
|
|
|
// so we compute the offsets at startup rather than hard-wiring them.
|
|
|
|
static int _name_offset;
|
|
|
|
static int _group_offset;
|
|
|
|
static int _contextClassLoader_offset;
|
|
|
|
static int _inheritedAccessControlContext_offset;
|
|
|
|
static int _priority_offset;
|
|
|
|
static int _eetop_offset;
|
|
|
|
static int _daemon_offset;
|
|
|
|
static int _stillborn_offset;
|
|
|
|
static int _stackSize_offset;
|
|
|
|
static int _tid_offset;
|
|
|
|
static int _thread_status_offset;
|
|
|
|
static int _park_blocker_offset;
|
|
|
|
static int _park_event_offset ;
|
|
|
|
|
|
|
|
static void compute_offsets();
|
|
|
|
|
|
|
|
public:
|
|
|
|
// Instance creation
|
|
|
|
static oop create();
|
|
|
|
// Returns the JavaThread associated with the thread obj
|
|
|
|
static JavaThread* thread(oop java_thread);
|
|
|
|
// Set JavaThread for instance
|
|
|
|
static void set_thread(oop java_thread, JavaThread* thread);
|
|
|
|
// Name
|
2014-11-13 01:57:09 +03:00
|
|
|
static oop name(oop java_thread);
|
|
|
|
static void set_name(oop java_thread, oop name);
|
2007-12-01 00:00:00 +00:00
|
|
|
// Priority
|
|
|
|
static ThreadPriority priority(oop java_thread);
|
|
|
|
static void set_priority(oop java_thread, ThreadPriority priority);
|
|
|
|
// Thread group
|
|
|
|
static oop threadGroup(oop java_thread);
|
|
|
|
// Stillborn
|
|
|
|
static bool is_stillborn(oop java_thread);
|
|
|
|
static void set_stillborn(oop java_thread);
|
|
|
|
// Alive (NOTE: this is not really a field, but provides the correct
|
|
|
|
// definition without doing a Java call)
|
|
|
|
static bool is_alive(oop java_thread);
|
|
|
|
// Daemon
|
|
|
|
static bool is_daemon(oop java_thread);
|
|
|
|
static void set_daemon(oop java_thread);
|
|
|
|
// Context ClassLoader
|
|
|
|
static oop context_class_loader(oop java_thread);
|
|
|
|
// Control context
|
|
|
|
static oop inherited_access_control_context(oop java_thread);
|
|
|
|
// Stack size hint
|
|
|
|
static jlong stackSize(oop java_thread);
|
|
|
|
// Thread ID
|
|
|
|
static jlong thread_id(oop java_thread);
|
|
|
|
|
|
|
|
// Blocker object responsible for thread parking
|
|
|
|
static oop park_blocker(oop java_thread);
|
|
|
|
|
|
|
|
// Pointer to type-stable park handler, encoded as jlong.
|
|
|
|
// Should be set when apparently null
|
|
|
|
// For details, see unsafe.cpp Unsafe_Unpark
|
|
|
|
static jlong park_event(oop java_thread);
|
|
|
|
static bool set_park_event(oop java_thread, jlong ptr);
|
|
|
|
|
|
|
|
// Java Thread Status for JVMTI and M&M use.
|
|
|
|
// This thread status info is saved in threadStatus field of
|
|
|
|
// java.lang.Thread java class.
|
|
|
|
enum ThreadStatus {
|
|
|
|
NEW = 0,
|
|
|
|
RUNNABLE = JVMTI_THREAD_STATE_ALIVE + // runnable / running
|
|
|
|
JVMTI_THREAD_STATE_RUNNABLE,
|
|
|
|
SLEEPING = JVMTI_THREAD_STATE_ALIVE + // Thread.sleep()
|
|
|
|
JVMTI_THREAD_STATE_WAITING +
|
|
|
|
JVMTI_THREAD_STATE_WAITING_WITH_TIMEOUT +
|
|
|
|
JVMTI_THREAD_STATE_SLEEPING,
|
|
|
|
IN_OBJECT_WAIT = JVMTI_THREAD_STATE_ALIVE + // Object.wait()
|
|
|
|
JVMTI_THREAD_STATE_WAITING +
|
|
|
|
JVMTI_THREAD_STATE_WAITING_INDEFINITELY +
|
|
|
|
JVMTI_THREAD_STATE_IN_OBJECT_WAIT,
|
|
|
|
IN_OBJECT_WAIT_TIMED = JVMTI_THREAD_STATE_ALIVE + // Object.wait(long)
|
|
|
|
JVMTI_THREAD_STATE_WAITING +
|
|
|
|
JVMTI_THREAD_STATE_WAITING_WITH_TIMEOUT +
|
|
|
|
JVMTI_THREAD_STATE_IN_OBJECT_WAIT,
|
|
|
|
PARKED = JVMTI_THREAD_STATE_ALIVE + // LockSupport.park()
|
|
|
|
JVMTI_THREAD_STATE_WAITING +
|
|
|
|
JVMTI_THREAD_STATE_WAITING_INDEFINITELY +
|
|
|
|
JVMTI_THREAD_STATE_PARKED,
|
|
|
|
PARKED_TIMED = JVMTI_THREAD_STATE_ALIVE + // LockSupport.park(long)
|
|
|
|
JVMTI_THREAD_STATE_WAITING +
|
|
|
|
JVMTI_THREAD_STATE_WAITING_WITH_TIMEOUT +
|
|
|
|
JVMTI_THREAD_STATE_PARKED,
|
|
|
|
BLOCKED_ON_MONITOR_ENTER = JVMTI_THREAD_STATE_ALIVE + // (re-)entering a synchronization block
|
|
|
|
JVMTI_THREAD_STATE_BLOCKED_ON_MONITOR_ENTER,
|
|
|
|
TERMINATED = JVMTI_THREAD_STATE_TERMINATED
|
|
|
|
};
|
|
|
|
// Write thread status info to threadStatus field of java.lang.Thread.
|
|
|
|
static void set_thread_status(oop java_thread_oop, ThreadStatus status);
|
|
|
|
// Read thread status info from threadStatus field of java.lang.Thread.
|
|
|
|
static ThreadStatus get_thread_status(oop java_thread_oop);
|
|
|
|
|
|
|
|
static const char* thread_status_name(oop java_thread_oop);
|
|
|
|
|
|
|
|
// Debugging
|
|
|
|
friend class JavaClasses;
|
|
|
|
};
|
|
|
|
|
|
|
|
// Interface to java.lang.ThreadGroup objects
|
|
|
|
|
|
|
|
class java_lang_ThreadGroup : AllStatic {
|
|
|
|
private:
|
|
|
|
static int _parent_offset;
|
|
|
|
static int _name_offset;
|
|
|
|
static int _threads_offset;
|
|
|
|
static int _groups_offset;
|
|
|
|
static int _maxPriority_offset;
|
|
|
|
static int _destroyed_offset;
|
|
|
|
static int _daemon_offset;
|
|
|
|
static int _vmAllowSuspension_offset;
|
|
|
|
static int _nthreads_offset;
|
|
|
|
static int _ngroups_offset;
|
|
|
|
|
|
|
|
static void compute_offsets();
|
|
|
|
|
|
|
|
public:
|
|
|
|
// parent ThreadGroup
|
|
|
|
static oop parent(oop java_thread_group);
|
|
|
|
// name
|
8141132: JEP 254: Compact Strings
Adopt a more space-efficient internal representation for strings.
Co-authored-by: Brent Christian <brent.christian@oracle.com>
Co-authored-by: Vivek Deshpande <vivek.r.deshpande@intel.com>
Co-authored-by: Charlie Hunt <charlie.hunt@oracle.com>
Co-authored-by: Vladimir Kozlov <vladimir.kozlov@oracle.com>
Co-authored-by: Roger Riggs <roger.riggs@oracle.com>
Co-authored-by: Xueming Shen <xueming.shen@oracle.com>
Co-authored-by: Aleksey Shipilev <aleksey.shipilev@oracle.com>
Co-authored-by: Sandhya Viswanathan <sandhya.viswanathan@intel.com>
Reviewed-by: alanb, bdelsart, coleenp, iklam, jiangli, jrose, kevinw, naoto, pliden, roland, smarks, twisti
2015-11-03 09:41:03 +01:00
|
|
|
static const char* name(oop java_thread_group);
|
2007-12-01 00:00:00 +00:00
|
|
|
// ("name as oop" accessor is not necessary)
|
|
|
|
// Number of threads in group
|
|
|
|
static int nthreads(oop java_thread_group);
|
|
|
|
// threads
|
|
|
|
static objArrayOop threads(oop java_thread_group);
|
|
|
|
// Number of threads in group
|
|
|
|
static int ngroups(oop java_thread_group);
|
|
|
|
// groups
|
|
|
|
static objArrayOop groups(oop java_thread_group);
|
|
|
|
// maxPriority in group
|
|
|
|
static ThreadPriority maxPriority(oop java_thread_group);
|
|
|
|
// Destroyed
|
|
|
|
static bool is_destroyed(oop java_thread_group);
|
|
|
|
// Daemon
|
|
|
|
static bool is_daemon(oop java_thread_group);
|
|
|
|
// vmAllowSuspension
|
|
|
|
static bool is_vmAllowSuspension(oop java_thread_group);
|
|
|
|
// Debugging
|
|
|
|
friend class JavaClasses;
|
|
|
|
};
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
// Interface to java.lang.Throwable objects
|
|
|
|
|
|
|
|
class java_lang_Throwable: AllStatic {
|
|
|
|
friend class BacktraceBuilder;
|
|
|
|
|
|
|
|
private:
|
|
|
|
// Offsets
|
|
|
|
enum {
|
|
|
|
hc_backtrace_offset = 0,
|
|
|
|
hc_detailMessage_offset = 1,
|
|
|
|
hc_cause_offset = 2, // New since 1.4
|
|
|
|
hc_stackTrace_offset = 3 // New since 1.4
|
|
|
|
};
|
2011-07-22 00:29:01 -07:00
|
|
|
enum {
|
|
|
|
hc_static_unassigned_stacktrace_offset = 0 // New since 1.7
|
|
|
|
};
|
2007-12-01 00:00:00 +00:00
|
|
|
// Trace constants
|
|
|
|
enum {
|
|
|
|
trace_methods_offset = 0,
|
|
|
|
trace_bcis_offset = 1,
|
6964458: Reimplement class meta-data storage to use native memory
Remove PermGen, allocate meta-data in metaspace linked to class loaders, rewrite GC walking, rewrite and rename metadata to be C++ classes
Co-authored-by: Stefan Karlsson <stefan.karlsson@oracle.com>
Co-authored-by: Mikael Gerdin <mikael.gerdin@oracle.com>
Co-authored-by: Tom Rodriguez <tom.rodriguez@oracle.com>
Reviewed-by: jmasa, stefank, never, coleenp, kvn, brutisso, mgerdin, dholmes, jrose, twisti, roland
2012-09-01 13:25:18 -04:00
|
|
|
trace_mirrors_offset = 2,
|
2015-03-20 02:44:51 -07:00
|
|
|
trace_cprefs_offset = 3,
|
|
|
|
trace_next_offset = 4,
|
|
|
|
trace_size = 5,
|
2007-12-01 00:00:00 +00:00
|
|
|
trace_chunk_size = 32
|
|
|
|
};
|
|
|
|
|
|
|
|
static int backtrace_offset;
|
|
|
|
static int detailMessage_offset;
|
|
|
|
static int cause_offset;
|
|
|
|
static int stackTrace_offset;
|
2011-07-22 00:29:01 -07:00
|
|
|
static int static_unassigned_stacktrace_offset;
|
2007-12-01 00:00:00 +00:00
|
|
|
|
|
|
|
// Printing
|
2015-03-20 02:44:51 -07:00
|
|
|
static char* print_stack_element_to_buffer(Handle mirror, int method, int version, int bci, int cpref);
|
2007-12-01 00:00:00 +00:00
|
|
|
// StackTrace (programmatic access, new since 1.4)
|
|
|
|
static void clear_stacktrace(oop throwable);
|
|
|
|
// No stack trace available
|
|
|
|
static const char* no_stack_trace_message();
|
2011-07-22 00:29:01 -07:00
|
|
|
// Stacktrace (post JDK 1.7.0 to allow immutability protocol to be followed)
|
|
|
|
static void set_stacktrace(oop throwable, oop st_element_array);
|
|
|
|
static oop unassigned_stacktrace();
|
2007-12-01 00:00:00 +00:00
|
|
|
|
|
|
|
public:
|
|
|
|
// Backtrace
|
|
|
|
static oop backtrace(oop throwable);
|
|
|
|
static void set_backtrace(oop throwable, oop value);
|
|
|
|
// Needed by JVMTI to filter out this internal field.
|
|
|
|
static int get_backtrace_offset() { return backtrace_offset;}
|
|
|
|
static int get_detailMessage_offset() { return detailMessage_offset;}
|
|
|
|
// Message
|
|
|
|
static oop message(oop throwable);
|
|
|
|
static oop message(Handle throwable);
|
|
|
|
static void set_message(oop throwable, oop value);
|
2014-07-09 22:37:48 -04:00
|
|
|
static Symbol* detail_message(oop throwable);
|
2013-01-17 13:40:31 -05:00
|
|
|
static void print_stack_element(outputStream *st, Handle mirror, int method,
|
2015-03-20 02:44:51 -07:00
|
|
|
int version, int bci, int cpref);
|
2015-10-23 16:48:38 -04:00
|
|
|
static void print_stack_element(outputStream *st, const methodHandle& method, int bci);
|
2007-12-01 00:00:00 +00:00
|
|
|
static void print_stack_usage(Handle stream);
|
|
|
|
|
|
|
|
// Allocate space for backtrace (created but stack trace not filled in)
|
|
|
|
static void allocate_backtrace(Handle throwable, TRAPS);
|
|
|
|
// Fill in current stack trace for throwable with preallocated backtrace (no GC)
|
|
|
|
static void fill_in_stack_trace_of_preallocated_backtrace(Handle throwable);
|
|
|
|
// Fill in current stack trace, can cause GC
|
2015-10-23 16:48:38 -04:00
|
|
|
static void fill_in_stack_trace(Handle throwable, const methodHandle& method, TRAPS);
|
|
|
|
static void fill_in_stack_trace(Handle throwable, const methodHandle& method = methodHandle());
|
2007-12-01 00:00:00 +00:00
|
|
|
// Programmatic access to stack trace
|
|
|
|
static oop get_stack_trace_element(oop throwable, int index, TRAPS);
|
|
|
|
static int get_stack_trace_depth(oop throwable, TRAPS);
|
|
|
|
// Printing
|
|
|
|
static void print(oop throwable, outputStream* st);
|
|
|
|
static void print(Handle throwable, outputStream* st);
|
|
|
|
static void print_stack_trace(oop throwable, outputStream* st);
|
|
|
|
// Debugging
|
|
|
|
friend class JavaClasses;
|
|
|
|
};
|
|
|
|
|
|
|
|
|
|
|
|
// Interface to java.lang.reflect.AccessibleObject objects
|
|
|
|
|
|
|
|
class java_lang_reflect_AccessibleObject: AllStatic {
|
|
|
|
private:
|
|
|
|
// Note that to reduce dependencies on the JDK we compute these
|
|
|
|
// offsets at run-time.
|
|
|
|
static int override_offset;
|
|
|
|
|
|
|
|
static void compute_offsets();
|
|
|
|
|
|
|
|
public:
|
|
|
|
// Accessors
|
|
|
|
static jboolean override(oop reflect);
|
|
|
|
static void set_override(oop reflect, jboolean value);
|
|
|
|
|
|
|
|
// Debugging
|
|
|
|
friend class JavaClasses;
|
|
|
|
};
|
|
|
|
|
|
|
|
|
|
|
|
// Interface to java.lang.reflect.Method objects
|
|
|
|
|
|
|
|
class java_lang_reflect_Method : public java_lang_reflect_AccessibleObject {
|
|
|
|
private:
|
|
|
|
// Note that to reduce dependencies on the JDK we compute these
|
|
|
|
// offsets at run-time.
|
|
|
|
static int clazz_offset;
|
|
|
|
static int name_offset;
|
|
|
|
static int returnType_offset;
|
|
|
|
static int parameterTypes_offset;
|
|
|
|
static int exceptionTypes_offset;
|
|
|
|
static int slot_offset;
|
|
|
|
static int modifiers_offset;
|
|
|
|
static int signature_offset;
|
|
|
|
static int annotations_offset;
|
|
|
|
static int parameter_annotations_offset;
|
|
|
|
static int annotation_default_offset;
|
2012-12-20 10:22:19 +01:00
|
|
|
static int type_annotations_offset;
|
2007-12-01 00:00:00 +00:00
|
|
|
|
|
|
|
static void compute_offsets();
|
|
|
|
|
|
|
|
public:
|
|
|
|
// Allocation
|
|
|
|
static Handle create(TRAPS);
|
|
|
|
|
|
|
|
// Accessors
|
|
|
|
static oop clazz(oop reflect);
|
|
|
|
static void set_clazz(oop reflect, oop value);
|
|
|
|
|
|
|
|
static oop name(oop method);
|
|
|
|
static void set_name(oop method, oop value);
|
|
|
|
|
|
|
|
static oop return_type(oop method);
|
|
|
|
static void set_return_type(oop method, oop value);
|
|
|
|
|
|
|
|
static oop parameter_types(oop method);
|
|
|
|
static void set_parameter_types(oop method, oop value);
|
|
|
|
|
|
|
|
static oop exception_types(oop method);
|
|
|
|
static void set_exception_types(oop method, oop value);
|
|
|
|
|
|
|
|
static int slot(oop reflect);
|
|
|
|
static void set_slot(oop reflect, int value);
|
|
|
|
|
|
|
|
static int modifiers(oop method);
|
|
|
|
static void set_modifiers(oop method, int value);
|
|
|
|
|
|
|
|
static bool has_signature_field();
|
|
|
|
static oop signature(oop method);
|
|
|
|
static void set_signature(oop method, oop value);
|
|
|
|
|
|
|
|
static bool has_annotations_field();
|
|
|
|
static oop annotations(oop method);
|
|
|
|
static void set_annotations(oop method, oop value);
|
|
|
|
|
|
|
|
static bool has_parameter_annotations_field();
|
|
|
|
static oop parameter_annotations(oop method);
|
|
|
|
static void set_parameter_annotations(oop method, oop value);
|
|
|
|
|
|
|
|
static bool has_annotation_default_field();
|
|
|
|
static oop annotation_default(oop method);
|
|
|
|
static void set_annotation_default(oop method, oop value);
|
|
|
|
|
2012-12-20 10:22:19 +01:00
|
|
|
static bool has_type_annotations_field();
|
|
|
|
static oop type_annotations(oop method);
|
|
|
|
static void set_type_annotations(oop method, oop value);
|
|
|
|
|
2007-12-01 00:00:00 +00:00
|
|
|
// Debugging
|
|
|
|
friend class JavaClasses;
|
|
|
|
};
|
|
|
|
|
|
|
|
|
|
|
|
// Interface to java.lang.reflect.Constructor objects
|
|
|
|
|
|
|
|
class java_lang_reflect_Constructor : public java_lang_reflect_AccessibleObject {
|
|
|
|
private:
|
|
|
|
// Note that to reduce dependencies on the JDK we compute these
|
|
|
|
// offsets at run-time.
|
|
|
|
static int clazz_offset;
|
|
|
|
static int parameterTypes_offset;
|
|
|
|
static int exceptionTypes_offset;
|
|
|
|
static int slot_offset;
|
|
|
|
static int modifiers_offset;
|
|
|
|
static int signature_offset;
|
|
|
|
static int annotations_offset;
|
|
|
|
static int parameter_annotations_offset;
|
2012-12-20 10:22:19 +01:00
|
|
|
static int type_annotations_offset;
|
2007-12-01 00:00:00 +00:00
|
|
|
|
|
|
|
static void compute_offsets();
|
|
|
|
|
|
|
|
public:
|
|
|
|
// Allocation
|
|
|
|
static Handle create(TRAPS);
|
|
|
|
|
|
|
|
// Accessors
|
|
|
|
static oop clazz(oop reflect);
|
|
|
|
static void set_clazz(oop reflect, oop value);
|
|
|
|
|
|
|
|
static oop parameter_types(oop constructor);
|
|
|
|
static void set_parameter_types(oop constructor, oop value);
|
|
|
|
|
|
|
|
static oop exception_types(oop constructor);
|
|
|
|
static void set_exception_types(oop constructor, oop value);
|
|
|
|
|
|
|
|
static int slot(oop reflect);
|
|
|
|
static void set_slot(oop reflect, int value);
|
|
|
|
|
|
|
|
static int modifiers(oop constructor);
|
|
|
|
static void set_modifiers(oop constructor, int value);
|
|
|
|
|
|
|
|
static bool has_signature_field();
|
|
|
|
static oop signature(oop constructor);
|
|
|
|
static void set_signature(oop constructor, oop value);
|
|
|
|
|
|
|
|
static bool has_annotations_field();
|
|
|
|
static oop annotations(oop constructor);
|
|
|
|
static void set_annotations(oop constructor, oop value);
|
|
|
|
|
|
|
|
static bool has_parameter_annotations_field();
|
|
|
|
static oop parameter_annotations(oop method);
|
|
|
|
static void set_parameter_annotations(oop method, oop value);
|
|
|
|
|
2012-12-20 10:22:19 +01:00
|
|
|
static bool has_type_annotations_field();
|
|
|
|
static oop type_annotations(oop constructor);
|
|
|
|
static void set_type_annotations(oop constructor, oop value);
|
|
|
|
|
2007-12-01 00:00:00 +00:00
|
|
|
// Debugging
|
|
|
|
friend class JavaClasses;
|
|
|
|
};
|
|
|
|
|
|
|
|
|
|
|
|
// Interface to java.lang.reflect.Field objects
|
|
|
|
|
|
|
|
class java_lang_reflect_Field : public java_lang_reflect_AccessibleObject {
|
|
|
|
private:
|
|
|
|
// Note that to reduce dependencies on the JDK we compute these
|
|
|
|
// offsets at run-time.
|
|
|
|
static int clazz_offset;
|
|
|
|
static int name_offset;
|
|
|
|
static int type_offset;
|
|
|
|
static int slot_offset;
|
|
|
|
static int modifiers_offset;
|
|
|
|
static int signature_offset;
|
|
|
|
static int annotations_offset;
|
2012-12-20 10:22:19 +01:00
|
|
|
static int type_annotations_offset;
|
2007-12-01 00:00:00 +00:00
|
|
|
|
|
|
|
static void compute_offsets();
|
|
|
|
|
|
|
|
public:
|
|
|
|
// Allocation
|
|
|
|
static Handle create(TRAPS);
|
|
|
|
|
|
|
|
// Accessors
|
|
|
|
static oop clazz(oop reflect);
|
|
|
|
static void set_clazz(oop reflect, oop value);
|
|
|
|
|
|
|
|
static oop name(oop field);
|
|
|
|
static void set_name(oop field, oop value);
|
|
|
|
|
|
|
|
static oop type(oop field);
|
|
|
|
static void set_type(oop field, oop value);
|
|
|
|
|
|
|
|
static int slot(oop reflect);
|
|
|
|
static void set_slot(oop reflect, int value);
|
|
|
|
|
|
|
|
static int modifiers(oop field);
|
|
|
|
static void set_modifiers(oop field, int value);
|
|
|
|
|
|
|
|
static bool has_signature_field();
|
|
|
|
static oop signature(oop constructor);
|
|
|
|
static void set_signature(oop constructor, oop value);
|
|
|
|
|
|
|
|
static bool has_annotations_field();
|
|
|
|
static oop annotations(oop constructor);
|
|
|
|
static void set_annotations(oop constructor, oop value);
|
|
|
|
|
|
|
|
static bool has_parameter_annotations_field();
|
|
|
|
static oop parameter_annotations(oop method);
|
|
|
|
static void set_parameter_annotations(oop method, oop value);
|
|
|
|
|
|
|
|
static bool has_annotation_default_field();
|
|
|
|
static oop annotation_default(oop method);
|
|
|
|
static void set_annotation_default(oop method, oop value);
|
|
|
|
|
2012-12-20 10:22:19 +01:00
|
|
|
static bool has_type_annotations_field();
|
|
|
|
static oop type_annotations(oop field);
|
|
|
|
static void set_type_annotations(oop field, oop value);
|
|
|
|
|
2007-12-01 00:00:00 +00:00
|
|
|
// Debugging
|
|
|
|
friend class JavaClasses;
|
|
|
|
};
|
|
|
|
|
2013-01-08 14:01:36 -05:00
|
|
|
class java_lang_reflect_Parameter {
|
|
|
|
private:
|
|
|
|
// Note that to reduce dependencies on the JDK we compute these
|
|
|
|
// offsets at run-time.
|
|
|
|
static int name_offset;
|
|
|
|
static int modifiers_offset;
|
|
|
|
static int index_offset;
|
|
|
|
static int executable_offset;
|
|
|
|
|
|
|
|
static void compute_offsets();
|
|
|
|
|
|
|
|
public:
|
|
|
|
// Allocation
|
|
|
|
static Handle create(TRAPS);
|
|
|
|
|
|
|
|
// Accessors
|
|
|
|
static oop name(oop field);
|
|
|
|
static void set_name(oop field, oop value);
|
|
|
|
|
|
|
|
static int index(oop reflect);
|
|
|
|
static void set_index(oop reflect, int value);
|
|
|
|
|
|
|
|
static int modifiers(oop reflect);
|
|
|
|
static void set_modifiers(oop reflect, int value);
|
|
|
|
|
|
|
|
static oop executable(oop constructor);
|
|
|
|
static void set_executable(oop constructor, oop value);
|
|
|
|
|
|
|
|
friend class JavaClasses;
|
|
|
|
};
|
|
|
|
|
2007-12-01 00:00:00 +00:00
|
|
|
// Interface to sun.reflect.ConstantPool objects
|
|
|
|
class sun_reflect_ConstantPool {
|
|
|
|
private:
|
|
|
|
// Note that to reduce dependencies on the JDK we compute these
|
|
|
|
// offsets at run-time.
|
6964458: Reimplement class meta-data storage to use native memory
Remove PermGen, allocate meta-data in metaspace linked to class loaders, rewrite GC walking, rewrite and rename metadata to be C++ classes
Co-authored-by: Stefan Karlsson <stefan.karlsson@oracle.com>
Co-authored-by: Mikael Gerdin <mikael.gerdin@oracle.com>
Co-authored-by: Tom Rodriguez <tom.rodriguez@oracle.com>
Reviewed-by: jmasa, stefank, never, coleenp, kvn, brutisso, mgerdin, dholmes, jrose, twisti, roland
2012-09-01 13:25:18 -04:00
|
|
|
static int _oop_offset;
|
2007-12-01 00:00:00 +00:00
|
|
|
|
|
|
|
static void compute_offsets();
|
|
|
|
|
|
|
|
public:
|
|
|
|
// Allocation
|
|
|
|
static Handle create(TRAPS);
|
|
|
|
|
|
|
|
// Accessors
|
6964458: Reimplement class meta-data storage to use native memory
Remove PermGen, allocate meta-data in metaspace linked to class loaders, rewrite GC walking, rewrite and rename metadata to be C++ classes
Co-authored-by: Stefan Karlsson <stefan.karlsson@oracle.com>
Co-authored-by: Mikael Gerdin <mikael.gerdin@oracle.com>
Co-authored-by: Tom Rodriguez <tom.rodriguez@oracle.com>
Reviewed-by: jmasa, stefank, never, coleenp, kvn, brutisso, mgerdin, dholmes, jrose, twisti, roland
2012-09-01 13:25:18 -04:00
|
|
|
static void set_cp(oop reflect, ConstantPool* value);
|
|
|
|
static int oop_offset() {
|
|
|
|
return _oop_offset;
|
2007-12-01 00:00:00 +00:00
|
|
|
}
|
|
|
|
|
6964458: Reimplement class meta-data storage to use native memory
Remove PermGen, allocate meta-data in metaspace linked to class loaders, rewrite GC walking, rewrite and rename metadata to be C++ classes
Co-authored-by: Stefan Karlsson <stefan.karlsson@oracle.com>
Co-authored-by: Mikael Gerdin <mikael.gerdin@oracle.com>
Co-authored-by: Tom Rodriguez <tom.rodriguez@oracle.com>
Reviewed-by: jmasa, stefank, never, coleenp, kvn, brutisso, mgerdin, dholmes, jrose, twisti, roland
2012-09-01 13:25:18 -04:00
|
|
|
static ConstantPool* get_cp(oop reflect);
|
|
|
|
|
2007-12-01 00:00:00 +00:00
|
|
|
// Debugging
|
|
|
|
friend class JavaClasses;
|
|
|
|
};
|
|
|
|
|
|
|
|
// Interface to sun.reflect.UnsafeStaticFieldAccessorImpl objects
|
|
|
|
class sun_reflect_UnsafeStaticFieldAccessorImpl {
|
|
|
|
private:
|
|
|
|
static int _base_offset;
|
|
|
|
static void compute_offsets();
|
|
|
|
|
|
|
|
public:
|
|
|
|
static int base_offset() {
|
|
|
|
return _base_offset;
|
|
|
|
}
|
|
|
|
|
|
|
|
// Debugging
|
|
|
|
friend class JavaClasses;
|
|
|
|
};
|
|
|
|
|
|
|
|
// Interface to java.lang primitive type boxing objects:
|
|
|
|
// - java.lang.Boolean
|
|
|
|
// - java.lang.Character
|
|
|
|
// - java.lang.Float
|
|
|
|
// - java.lang.Double
|
|
|
|
// - java.lang.Byte
|
|
|
|
// - java.lang.Short
|
|
|
|
// - java.lang.Integer
|
|
|
|
// - java.lang.Long
|
|
|
|
|
|
|
|
// This could be separated out into 8 individual classes.
|
|
|
|
|
|
|
|
class java_lang_boxing_object: AllStatic {
|
|
|
|
private:
|
|
|
|
enum {
|
|
|
|
hc_value_offset = 0
|
|
|
|
};
|
|
|
|
static int value_offset;
|
2008-05-21 16:31:35 -07:00
|
|
|
static int long_value_offset;
|
2007-12-01 00:00:00 +00:00
|
|
|
|
2008-04-29 19:45:22 -07:00
|
|
|
static oop initialize_and_allocate(BasicType type, TRAPS);
|
2007-12-01 00:00:00 +00:00
|
|
|
public:
|
|
|
|
// Allocation. Returns a boxed value, or NULL for invalid type.
|
|
|
|
static oop create(BasicType type, jvalue* value, TRAPS);
|
|
|
|
// Accessors. Returns the basic type being boxed, or T_ILLEGAL for invalid oop.
|
|
|
|
static BasicType get_value(oop box, jvalue* value);
|
|
|
|
static BasicType set_value(oop box, jvalue* value);
|
2008-04-29 19:45:22 -07:00
|
|
|
static BasicType basic_type(oop box);
|
|
|
|
static bool is_instance(oop box) { return basic_type(box) != T_ILLEGAL; }
|
|
|
|
static bool is_instance(oop box, BasicType type) { return basic_type(box) == type; }
|
2009-03-20 23:19:36 -07:00
|
|
|
static void print(oop box, outputStream* st) { jvalue value; print(get_value(box, &value), &value, st); }
|
|
|
|
static void print(BasicType type, jvalue* value, outputStream* st);
|
2007-12-01 00:00:00 +00:00
|
|
|
|
2008-05-21 16:31:35 -07:00
|
|
|
static int value_offset_in_bytes(BasicType type) {
|
|
|
|
return ( type == T_LONG || type == T_DOUBLE ) ? long_value_offset :
|
|
|
|
value_offset;
|
|
|
|
}
|
2007-12-01 00:00:00 +00:00
|
|
|
|
|
|
|
// Debugging
|
|
|
|
friend class JavaClasses;
|
|
|
|
};
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
// Interface to java.lang.ref.Reference objects
|
|
|
|
|
|
|
|
class java_lang_ref_Reference: AllStatic {
|
|
|
|
public:
|
|
|
|
enum {
|
|
|
|
hc_referent_offset = 0,
|
|
|
|
hc_queue_offset = 1,
|
|
|
|
hc_next_offset = 2,
|
|
|
|
hc_discovered_offset = 3 // Is not last, see SoftRefs.
|
|
|
|
};
|
|
|
|
enum {
|
|
|
|
hc_static_lock_offset = 0,
|
|
|
|
hc_static_pending_offset = 1
|
|
|
|
};
|
|
|
|
|
|
|
|
static int referent_offset;
|
|
|
|
static int queue_offset;
|
|
|
|
static int next_offset;
|
|
|
|
static int discovered_offset;
|
|
|
|
static int static_lock_offset;
|
|
|
|
static int static_pending_offset;
|
|
|
|
static int number_of_fake_oop_fields;
|
|
|
|
|
|
|
|
// Accessors
|
6420645: Create a vm that uses compressed oops for up to 32gb heapsizes
Compressed oops in instances, arrays, and headers. Code contributors are coleenp, phh, never, swamyv
Reviewed-by: jmasa, kamg, acorn, tbell, kvn, rasbold
2008-04-13 17:43:42 -04:00
|
|
|
static oop referent(oop ref) {
|
|
|
|
return ref->obj_field(referent_offset);
|
|
|
|
}
|
|
|
|
static void set_referent(oop ref, oop value) {
|
|
|
|
ref->obj_field_put(referent_offset, value);
|
|
|
|
}
|
|
|
|
static void set_referent_raw(oop ref, oop value) {
|
2011-09-08 05:11:31 -07:00
|
|
|
ref->obj_field_put_raw(referent_offset, value);
|
6420645: Create a vm that uses compressed oops for up to 32gb heapsizes
Compressed oops in instances, arrays, and headers. Code contributors are coleenp, phh, never, swamyv
Reviewed-by: jmasa, kamg, acorn, tbell, kvn, rasbold
2008-04-13 17:43:42 -04:00
|
|
|
}
|
|
|
|
static HeapWord* referent_addr(oop ref) {
|
|
|
|
return ref->obj_field_addr<HeapWord>(referent_offset);
|
|
|
|
}
|
|
|
|
static oop next(oop ref) {
|
|
|
|
return ref->obj_field(next_offset);
|
|
|
|
}
|
|
|
|
static void set_next(oop ref, oop value) {
|
|
|
|
ref->obj_field_put(next_offset, value);
|
|
|
|
}
|
|
|
|
static void set_next_raw(oop ref, oop value) {
|
2011-09-08 05:11:31 -07:00
|
|
|
ref->obj_field_put_raw(next_offset, value);
|
6420645: Create a vm that uses compressed oops for up to 32gb heapsizes
Compressed oops in instances, arrays, and headers. Code contributors are coleenp, phh, never, swamyv
Reviewed-by: jmasa, kamg, acorn, tbell, kvn, rasbold
2008-04-13 17:43:42 -04:00
|
|
|
}
|
|
|
|
static HeapWord* next_addr(oop ref) {
|
|
|
|
return ref->obj_field_addr<HeapWord>(next_offset);
|
|
|
|
}
|
|
|
|
static oop discovered(oop ref) {
|
|
|
|
return ref->obj_field(discovered_offset);
|
|
|
|
}
|
|
|
|
static void set_discovered(oop ref, oop value) {
|
|
|
|
ref->obj_field_put(discovered_offset, value);
|
|
|
|
}
|
|
|
|
static void set_discovered_raw(oop ref, oop value) {
|
2011-09-08 05:11:31 -07:00
|
|
|
ref->obj_field_put_raw(discovered_offset, value);
|
6420645: Create a vm that uses compressed oops for up to 32gb heapsizes
Compressed oops in instances, arrays, and headers. Code contributors are coleenp, phh, never, swamyv
Reviewed-by: jmasa, kamg, acorn, tbell, kvn, rasbold
2008-04-13 17:43:42 -04:00
|
|
|
}
|
|
|
|
static HeapWord* discovered_addr(oop ref) {
|
|
|
|
return ref->obj_field_addr<HeapWord>(discovered_offset);
|
|
|
|
}
|
2007-12-01 00:00:00 +00:00
|
|
|
// Accessors for statics
|
6420645: Create a vm that uses compressed oops for up to 32gb heapsizes
Compressed oops in instances, arrays, and headers. Code contributors are coleenp, phh, never, swamyv
Reviewed-by: jmasa, kamg, acorn, tbell, kvn, rasbold
2008-04-13 17:43:42 -04:00
|
|
|
static oop pending_list_lock();
|
|
|
|
static oop pending_list();
|
2007-12-01 00:00:00 +00:00
|
|
|
|
6964458: Reimplement class meta-data storage to use native memory
Remove PermGen, allocate meta-data in metaspace linked to class loaders, rewrite GC walking, rewrite and rename metadata to be C++ classes
Co-authored-by: Stefan Karlsson <stefan.karlsson@oracle.com>
Co-authored-by: Mikael Gerdin <mikael.gerdin@oracle.com>
Co-authored-by: Tom Rodriguez <tom.rodriguez@oracle.com>
Reviewed-by: jmasa, stefank, never, coleenp, kvn, brutisso, mgerdin, dholmes, jrose, twisti, roland
2012-09-01 13:25:18 -04:00
|
|
|
static HeapWord* pending_list_lock_addr();
|
6420645: Create a vm that uses compressed oops for up to 32gb heapsizes
Compressed oops in instances, arrays, and headers. Code contributors are coleenp, phh, never, swamyv
Reviewed-by: jmasa, kamg, acorn, tbell, kvn, rasbold
2008-04-13 17:43:42 -04:00
|
|
|
static HeapWord* pending_list_addr();
|
2007-12-01 00:00:00 +00:00
|
|
|
};
|
|
|
|
|
|
|
|
|
|
|
|
// Interface to java.lang.ref.SoftReference objects
|
|
|
|
|
|
|
|
class java_lang_ref_SoftReference: public java_lang_ref_Reference {
|
|
|
|
public:
|
|
|
|
enum {
|
|
|
|
// The timestamp is a long field and may need to be adjusted for alignment.
|
2008-05-21 16:31:35 -07:00
|
|
|
hc_timestamp_offset = hc_discovered_offset + 1
|
2007-12-01 00:00:00 +00:00
|
|
|
};
|
|
|
|
enum {
|
|
|
|
hc_static_clock_offset = 0
|
|
|
|
};
|
|
|
|
|
|
|
|
static int timestamp_offset;
|
|
|
|
static int static_clock_offset;
|
|
|
|
|
|
|
|
// Accessors
|
|
|
|
static jlong timestamp(oop ref);
|
|
|
|
|
|
|
|
// Accessors for statics
|
|
|
|
static jlong clock();
|
|
|
|
static void set_clock(jlong value);
|
|
|
|
};
|
|
|
|
|
2011-03-11 22:34:57 -08:00
|
|
|
// Interface to java.lang.invoke.MethodHandle objects
|
2009-04-08 10:56:49 -07:00
|
|
|
|
|
|
|
class MethodHandleEntry;
|
|
|
|
|
2011-03-11 22:34:57 -08:00
|
|
|
class java_lang_invoke_MethodHandle: AllStatic {
|
2009-04-08 10:56:49 -07:00
|
|
|
friend class JavaClasses;
|
|
|
|
|
|
|
|
private:
|
2012-07-24 10:51:00 -07:00
|
|
|
static int _type_offset; // the MethodType of this MH
|
|
|
|
static int _form_offset; // the LambdaForm of this MH
|
2009-04-08 10:56:49 -07:00
|
|
|
|
|
|
|
static void compute_offsets();
|
|
|
|
|
|
|
|
public:
|
|
|
|
// Accessors
|
|
|
|
static oop type(oop mh);
|
|
|
|
static void set_type(oop mh, oop mtype);
|
|
|
|
|
2012-07-24 10:51:00 -07:00
|
|
|
static oop form(oop mh);
|
|
|
|
static void set_form(oop mh, oop lform);
|
2009-04-08 10:56:49 -07:00
|
|
|
|
|
|
|
// Testers
|
6964458: Reimplement class meta-data storage to use native memory
Remove PermGen, allocate meta-data in metaspace linked to class loaders, rewrite GC walking, rewrite and rename metadata to be C++ classes
Co-authored-by: Stefan Karlsson <stefan.karlsson@oracle.com>
Co-authored-by: Mikael Gerdin <mikael.gerdin@oracle.com>
Co-authored-by: Tom Rodriguez <tom.rodriguez@oracle.com>
Reviewed-by: jmasa, stefank, never, coleenp, kvn, brutisso, mgerdin, dholmes, jrose, twisti, roland
2012-09-01 13:25:18 -04:00
|
|
|
static bool is_subclass(Klass* klass) {
|
2012-11-12 16:15:05 -05:00
|
|
|
return klass->is_subclass_of(SystemDictionary::MethodHandle_klass());
|
2009-04-08 10:56:49 -07:00
|
|
|
}
|
2015-02-13 14:37:35 +01:00
|
|
|
static bool is_instance(oop obj);
|
2009-04-08 10:56:49 -07:00
|
|
|
|
|
|
|
// Accessors for code generation:
|
|
|
|
static int type_offset_in_bytes() { return _type_offset; }
|
2012-07-24 10:51:00 -07:00
|
|
|
static int form_offset_in_bytes() { return _form_offset; }
|
2009-04-08 10:56:49 -07:00
|
|
|
};
|
|
|
|
|
2013-08-06 16:33:59 -07:00
|
|
|
// Interface to java.lang.invoke.DirectMethodHandle objects
|
|
|
|
|
|
|
|
class java_lang_invoke_DirectMethodHandle: AllStatic {
|
|
|
|
friend class JavaClasses;
|
|
|
|
|
|
|
|
private:
|
|
|
|
static int _member_offset; // the MemberName of this DMH
|
|
|
|
|
|
|
|
static void compute_offsets();
|
|
|
|
|
|
|
|
public:
|
|
|
|
// Accessors
|
|
|
|
static oop member(oop mh);
|
|
|
|
|
|
|
|
// Testers
|
|
|
|
static bool is_subclass(Klass* klass) {
|
|
|
|
return klass->is_subclass_of(SystemDictionary::DirectMethodHandle_klass());
|
|
|
|
}
|
2015-02-13 14:37:35 +01:00
|
|
|
static bool is_instance(oop obj);
|
2013-08-06 16:33:59 -07:00
|
|
|
|
|
|
|
// Accessors for code generation:
|
|
|
|
static int member_offset_in_bytes() { return _member_offset; }
|
|
|
|
};
|
|
|
|
|
2012-07-24 10:51:00 -07:00
|
|
|
// Interface to java.lang.invoke.LambdaForm objects
|
|
|
|
// (These are a private interface for managing adapter code generation.)
|
2011-09-10 17:29:02 -07:00
|
|
|
|
2012-07-24 10:51:00 -07:00
|
|
|
class java_lang_invoke_LambdaForm: AllStatic {
|
2009-04-08 10:56:49 -07:00
|
|
|
friend class JavaClasses;
|
|
|
|
|
|
|
|
private:
|
2012-07-24 10:51:00 -07:00
|
|
|
static int _vmentry_offset; // type is MemberName
|
2009-04-08 10:56:49 -07:00
|
|
|
|
2011-09-02 20:58:21 -07:00
|
|
|
static void compute_offsets();
|
|
|
|
|
|
|
|
public:
|
|
|
|
// Accessors
|
2012-07-24 10:51:00 -07:00
|
|
|
static oop vmentry(oop lform);
|
|
|
|
static void set_vmentry(oop lform, oop invoker);
|
2011-09-02 20:58:21 -07:00
|
|
|
|
|
|
|
// Testers
|
6964458: Reimplement class meta-data storage to use native memory
Remove PermGen, allocate meta-data in metaspace linked to class loaders, rewrite GC walking, rewrite and rename metadata to be C++ classes
Co-authored-by: Stefan Karlsson <stefan.karlsson@oracle.com>
Co-authored-by: Mikael Gerdin <mikael.gerdin@oracle.com>
Co-authored-by: Tom Rodriguez <tom.rodriguez@oracle.com>
Reviewed-by: jmasa, stefank, never, coleenp, kvn, brutisso, mgerdin, dholmes, jrose, twisti, roland
2012-09-01 13:25:18 -04:00
|
|
|
static bool is_subclass(Klass* klass) {
|
2012-07-24 10:51:00 -07:00
|
|
|
return SystemDictionary::LambdaForm_klass() != NULL &&
|
2012-11-12 16:15:05 -05:00
|
|
|
klass->is_subclass_of(SystemDictionary::LambdaForm_klass());
|
2011-09-02 20:58:21 -07:00
|
|
|
}
|
2015-02-13 14:37:35 +01:00
|
|
|
static bool is_instance(oop obj);
|
2011-09-02 20:58:21 -07:00
|
|
|
|
|
|
|
// Accessors for code generation:
|
2012-07-24 10:51:00 -07:00
|
|
|
static int vmentry_offset_in_bytes() { return _vmentry_offset; }
|
2011-09-02 20:58:21 -07:00
|
|
|
};
|
|
|
|
|
|
|
|
|
2011-03-11 22:34:57 -08:00
|
|
|
// Interface to java.lang.invoke.MemberName objects
|
2009-04-08 10:56:49 -07:00
|
|
|
// (These are a private interface for Java code to query the class hierarchy.)
|
|
|
|
|
2012-07-24 10:51:00 -07:00
|
|
|
#define MEMBERNAME_INJECTED_FIELDS(macro) \
|
6964458: Reimplement class meta-data storage to use native memory
Remove PermGen, allocate meta-data in metaspace linked to class loaders, rewrite GC walking, rewrite and rename metadata to be C++ classes
Co-authored-by: Stefan Karlsson <stefan.karlsson@oracle.com>
Co-authored-by: Mikael Gerdin <mikael.gerdin@oracle.com>
Co-authored-by: Tom Rodriguez <tom.rodriguez@oracle.com>
Reviewed-by: jmasa, stefank, never, coleenp, kvn, brutisso, mgerdin, dholmes, jrose, twisti, roland
2012-09-01 13:25:18 -04:00
|
|
|
macro(java_lang_invoke_MemberName, vmloader, object_signature, false) \
|
2012-07-24 10:51:00 -07:00
|
|
|
macro(java_lang_invoke_MemberName, vmindex, intptr_signature, false) \
|
6964458: Reimplement class meta-data storage to use native memory
Remove PermGen, allocate meta-data in metaspace linked to class loaders, rewrite GC walking, rewrite and rename metadata to be C++ classes
Co-authored-by: Stefan Karlsson <stefan.karlsson@oracle.com>
Co-authored-by: Mikael Gerdin <mikael.gerdin@oracle.com>
Co-authored-by: Tom Rodriguez <tom.rodriguez@oracle.com>
Reviewed-by: jmasa, stefank, never, coleenp, kvn, brutisso, mgerdin, dholmes, jrose, twisti, roland
2012-09-01 13:25:18 -04:00
|
|
|
macro(java_lang_invoke_MemberName, vmtarget, intptr_signature, false)
|
2011-09-10 17:29:02 -07:00
|
|
|
|
2011-03-11 22:34:57 -08:00
|
|
|
class java_lang_invoke_MemberName: AllStatic {
|
2009-04-08 10:56:49 -07:00
|
|
|
friend class JavaClasses;
|
|
|
|
|
|
|
|
private:
|
2011-03-11 22:34:57 -08:00
|
|
|
// From java.lang.invoke.MemberName:
|
2009-04-08 10:56:49 -07:00
|
|
|
// private Class<?> clazz; // class in which the method is defined
|
|
|
|
// private String name; // may be null if not yet materialized
|
|
|
|
// private Object type; // may be null if not yet materialized
|
|
|
|
// private int flags; // modifier bits; see reflect.Modifier
|
6964458: Reimplement class meta-data storage to use native memory
Remove PermGen, allocate meta-data in metaspace linked to class loaders, rewrite GC walking, rewrite and rename metadata to be C++ classes
Co-authored-by: Stefan Karlsson <stefan.karlsson@oracle.com>
Co-authored-by: Mikael Gerdin <mikael.gerdin@oracle.com>
Co-authored-by: Tom Rodriguez <tom.rodriguez@oracle.com>
Reviewed-by: jmasa, stefank, never, coleenp, kvn, brutisso, mgerdin, dholmes, jrose, twisti, roland
2012-09-01 13:25:18 -04:00
|
|
|
// private intptr vmtarget; // VM-specific target value
|
2012-07-24 10:51:00 -07:00
|
|
|
// private intptr_t vmindex; // member index within class or interface
|
2009-04-08 10:56:49 -07:00
|
|
|
static int _clazz_offset;
|
|
|
|
static int _name_offset;
|
|
|
|
static int _type_offset;
|
|
|
|
static int _flags_offset;
|
|
|
|
static int _vmtarget_offset;
|
6964458: Reimplement class meta-data storage to use native memory
Remove PermGen, allocate meta-data in metaspace linked to class loaders, rewrite GC walking, rewrite and rename metadata to be C++ classes
Co-authored-by: Stefan Karlsson <stefan.karlsson@oracle.com>
Co-authored-by: Mikael Gerdin <mikael.gerdin@oracle.com>
Co-authored-by: Tom Rodriguez <tom.rodriguez@oracle.com>
Reviewed-by: jmasa, stefank, never, coleenp, kvn, brutisso, mgerdin, dholmes, jrose, twisti, roland
2012-09-01 13:25:18 -04:00
|
|
|
static int _vmloader_offset;
|
2009-04-08 10:56:49 -07:00
|
|
|
static int _vmindex_offset;
|
|
|
|
|
|
|
|
static void compute_offsets();
|
|
|
|
|
|
|
|
public:
|
|
|
|
// Accessors
|
|
|
|
static oop clazz(oop mname);
|
|
|
|
static void set_clazz(oop mname, oop clazz);
|
|
|
|
|
|
|
|
static oop type(oop mname);
|
|
|
|
static void set_type(oop mname, oop type);
|
|
|
|
|
|
|
|
static oop name(oop mname);
|
|
|
|
static void set_name(oop mname, oop name);
|
|
|
|
|
|
|
|
static int flags(oop mname);
|
|
|
|
static void set_flags(oop mname, int flags);
|
|
|
|
|
6964458: Reimplement class meta-data storage to use native memory
Remove PermGen, allocate meta-data in metaspace linked to class loaders, rewrite GC walking, rewrite and rename metadata to be C++ classes
Co-authored-by: Stefan Karlsson <stefan.karlsson@oracle.com>
Co-authored-by: Mikael Gerdin <mikael.gerdin@oracle.com>
Co-authored-by: Tom Rodriguez <tom.rodriguez@oracle.com>
Reviewed-by: jmasa, stefank, never, coleenp, kvn, brutisso, mgerdin, dholmes, jrose, twisti, roland
2012-09-01 13:25:18 -04:00
|
|
|
static Metadata* vmtarget(oop mname);
|
|
|
|
static void set_vmtarget(oop mname, Metadata* target);
|
2009-04-08 10:56:49 -07:00
|
|
|
|
2012-07-24 10:51:00 -07:00
|
|
|
static intptr_t vmindex(oop mname);
|
|
|
|
static void set_vmindex(oop mname, intptr_t index);
|
2009-04-08 10:56:49 -07:00
|
|
|
|
|
|
|
// Testers
|
6964458: Reimplement class meta-data storage to use native memory
Remove PermGen, allocate meta-data in metaspace linked to class loaders, rewrite GC walking, rewrite and rename metadata to be C++ classes
Co-authored-by: Stefan Karlsson <stefan.karlsson@oracle.com>
Co-authored-by: Mikael Gerdin <mikael.gerdin@oracle.com>
Co-authored-by: Tom Rodriguez <tom.rodriguez@oracle.com>
Reviewed-by: jmasa, stefank, never, coleenp, kvn, brutisso, mgerdin, dholmes, jrose, twisti, roland
2012-09-01 13:25:18 -04:00
|
|
|
static bool is_subclass(Klass* klass) {
|
2012-11-12 16:15:05 -05:00
|
|
|
return klass->is_subclass_of(SystemDictionary::MemberName_klass());
|
2009-04-08 10:56:49 -07:00
|
|
|
}
|
2015-02-13 14:37:35 +01:00
|
|
|
static bool is_instance(oop obj);
|
2009-04-08 10:56:49 -07:00
|
|
|
|
2014-11-19 13:02:11 -05:00
|
|
|
static bool is_method(oop obj);
|
|
|
|
|
2009-04-08 10:56:49 -07:00
|
|
|
// Relevant integer codes (keep these in synch. with MethodHandleNatives.Constants):
|
|
|
|
enum {
|
2013-03-25 17:13:26 -07:00
|
|
|
MN_IS_METHOD = 0x00010000, // method (not constructor)
|
|
|
|
MN_IS_CONSTRUCTOR = 0x00020000, // constructor
|
|
|
|
MN_IS_FIELD = 0x00040000, // field
|
|
|
|
MN_IS_TYPE = 0x00080000, // nested type
|
|
|
|
MN_CALLER_SENSITIVE = 0x00100000, // @CallerSensitive annotation detected
|
2012-07-24 10:51:00 -07:00
|
|
|
MN_REFERENCE_KIND_SHIFT = 24, // refKind
|
2013-03-25 17:13:26 -07:00
|
|
|
MN_REFERENCE_KIND_MASK = 0x0F000000 >> MN_REFERENCE_KIND_SHIFT,
|
2012-07-24 10:51:00 -07:00
|
|
|
// The SEARCH_* bits are not for MN.flags but for the matchFlags argument of MHN.getMembers:
|
2013-03-25 17:13:26 -07:00
|
|
|
MN_SEARCH_SUPERCLASSES = 0x00100000, // walk super classes
|
|
|
|
MN_SEARCH_INTERFACES = 0x00200000 // walk implemented interfaces
|
2009-04-08 10:56:49 -07:00
|
|
|
};
|
|
|
|
|
|
|
|
// Accessors for code generation:
|
|
|
|
static int clazz_offset_in_bytes() { return _clazz_offset; }
|
|
|
|
static int type_offset_in_bytes() { return _type_offset; }
|
|
|
|
static int name_offset_in_bytes() { return _name_offset; }
|
|
|
|
static int flags_offset_in_bytes() { return _flags_offset; }
|
|
|
|
static int vmtarget_offset_in_bytes() { return _vmtarget_offset; }
|
|
|
|
static int vmindex_offset_in_bytes() { return _vmindex_offset; }
|
|
|
|
};
|
|
|
|
|
|
|
|
|
2011-03-11 22:34:57 -08:00
|
|
|
// Interface to java.lang.invoke.MethodType objects
|
2009-04-08 10:56:49 -07:00
|
|
|
|
2011-03-11 22:34:57 -08:00
|
|
|
class java_lang_invoke_MethodType: AllStatic {
|
2009-04-08 10:56:49 -07:00
|
|
|
friend class JavaClasses;
|
|
|
|
|
|
|
|
private:
|
|
|
|
static int _rtype_offset;
|
|
|
|
static int _ptypes_offset;
|
|
|
|
|
|
|
|
static void compute_offsets();
|
|
|
|
|
|
|
|
public:
|
|
|
|
// Accessors
|
|
|
|
static oop rtype(oop mt);
|
|
|
|
static objArrayOop ptypes(oop mt);
|
|
|
|
|
|
|
|
static oop ptype(oop mt, int index);
|
2010-01-04 15:52:40 +01:00
|
|
|
static int ptype_count(oop mt);
|
2009-04-08 10:56:49 -07:00
|
|
|
|
2012-07-24 10:51:00 -07:00
|
|
|
static int ptype_slot_count(oop mt); // extra counts for long/double
|
|
|
|
static int rtype_slot_count(oop mt); // extra counts for long/double
|
|
|
|
|
2011-01-27 16:11:27 -08:00
|
|
|
static Symbol* as_signature(oop mt, bool intern_if_not_found, TRAPS);
|
2009-04-08 10:56:49 -07:00
|
|
|
static void print_signature(oop mt, outputStream* st);
|
|
|
|
|
2015-02-13 14:37:35 +01:00
|
|
|
static bool is_instance(oop obj);
|
2009-04-08 10:56:49 -07:00
|
|
|
|
2011-06-23 17:14:06 -07:00
|
|
|
static bool equals(oop mt1, oop mt2);
|
|
|
|
|
2009-04-08 10:56:49 -07:00
|
|
|
// Accessors for code generation:
|
|
|
|
static int rtype_offset_in_bytes() { return _rtype_offset; }
|
|
|
|
static int ptypes_offset_in_bytes() { return _ptypes_offset; }
|
|
|
|
};
|
|
|
|
|
|
|
|
|
2011-03-11 22:34:57 -08:00
|
|
|
// Interface to java.lang.invoke.CallSite objects
|
2009-04-21 23:21:04 -07:00
|
|
|
|
2011-03-11 22:34:57 -08:00
|
|
|
class java_lang_invoke_CallSite: AllStatic {
|
2009-04-21 23:21:04 -07:00
|
|
|
friend class JavaClasses;
|
|
|
|
|
|
|
|
private:
|
|
|
|
static int _target_offset;
|
2015-04-17 18:17:06 +03:00
|
|
|
static int _context_offset;
|
2009-04-21 23:21:04 -07:00
|
|
|
|
|
|
|
static void compute_offsets();
|
|
|
|
|
|
|
|
public:
|
|
|
|
// Accessors
|
2015-04-17 18:17:06 +03:00
|
|
|
static oop target( oop site);
|
|
|
|
static void set_target( oop site, oop target);
|
|
|
|
static void set_target_volatile( oop site, oop target);
|
|
|
|
|
2015-05-15 19:23:11 +03:00
|
|
|
static oop context(oop site);
|
2010-05-01 02:42:18 -07:00
|
|
|
|
2010-01-04 18:38:08 +01:00
|
|
|
// Testers
|
6964458: Reimplement class meta-data storage to use native memory
Remove PermGen, allocate meta-data in metaspace linked to class loaders, rewrite GC walking, rewrite and rename metadata to be C++ classes
Co-authored-by: Stefan Karlsson <stefan.karlsson@oracle.com>
Co-authored-by: Mikael Gerdin <mikael.gerdin@oracle.com>
Co-authored-by: Tom Rodriguez <tom.rodriguez@oracle.com>
Reviewed-by: jmasa, stefank, never, coleenp, kvn, brutisso, mgerdin, dholmes, jrose, twisti, roland
2012-09-01 13:25:18 -04:00
|
|
|
static bool is_subclass(Klass* klass) {
|
2012-11-12 16:15:05 -05:00
|
|
|
return klass->is_subclass_of(SystemDictionary::CallSite_klass());
|
2010-01-04 18:38:08 +01:00
|
|
|
}
|
2015-02-13 14:37:35 +01:00
|
|
|
static bool is_instance(oop obj);
|
2010-01-04 18:38:08 +01:00
|
|
|
|
2009-04-21 23:21:04 -07:00
|
|
|
// Accessors for code generation:
|
|
|
|
static int target_offset_in_bytes() { return _target_offset; }
|
|
|
|
};
|
2009-04-08 10:56:49 -07:00
|
|
|
|
2015-05-15 19:23:11 +03:00
|
|
|
// Interface to java.lang.invoke.MethodHandleNatives$CallSiteContext objects
|
|
|
|
|
|
|
|
#define CALLSITECONTEXT_INJECTED_FIELDS(macro) \
|
|
|
|
macro(java_lang_invoke_MethodHandleNatives_CallSiteContext, vmdependencies, intptr_signature, false)
|
|
|
|
|
|
|
|
class java_lang_invoke_MethodHandleNatives_CallSiteContext : AllStatic {
|
|
|
|
friend class JavaClasses;
|
|
|
|
|
|
|
|
private:
|
|
|
|
static int _vmdependencies_offset;
|
|
|
|
|
|
|
|
static void compute_offsets();
|
|
|
|
|
|
|
|
public:
|
|
|
|
// Accessors
|
|
|
|
static nmethodBucket* vmdependencies(oop context);
|
|
|
|
static void set_vmdependencies(oop context, nmethodBucket* bucket);
|
|
|
|
|
|
|
|
// Testers
|
|
|
|
static bool is_subclass(Klass* klass) {
|
|
|
|
return klass->is_subclass_of(SystemDictionary::Context_klass());
|
|
|
|
}
|
|
|
|
static bool is_instance(oop obj);
|
|
|
|
};
|
|
|
|
|
2007-12-01 00:00:00 +00:00
|
|
|
// Interface to java.security.AccessControlContext objects
|
|
|
|
|
|
|
|
class java_security_AccessControlContext: AllStatic {
|
|
|
|
private:
|
|
|
|
// Note that for this class the layout changed between JDK1.2 and JDK1.3,
|
|
|
|
// so we compute the offsets at startup rather than hard-wiring them.
|
|
|
|
static int _context_offset;
|
|
|
|
static int _privilegedContext_offset;
|
|
|
|
static int _isPrivileged_offset;
|
2013-04-05 10:18:36 -04:00
|
|
|
static int _isAuthorized_offset;
|
2007-12-01 00:00:00 +00:00
|
|
|
|
|
|
|
static void compute_offsets();
|
|
|
|
public:
|
|
|
|
static oop create(objArrayHandle context, bool isPrivileged, Handle privileged_context, TRAPS);
|
|
|
|
|
2013-04-05 10:18:36 -04:00
|
|
|
static bool is_authorized(Handle context);
|
|
|
|
|
2007-12-01 00:00:00 +00:00
|
|
|
// Debugging/initialization
|
|
|
|
friend class JavaClasses;
|
|
|
|
};
|
|
|
|
|
|
|
|
|
|
|
|
// Interface to java.lang.ClassLoader objects
|
|
|
|
|
6964458: Reimplement class meta-data storage to use native memory
Remove PermGen, allocate meta-data in metaspace linked to class loaders, rewrite GC walking, rewrite and rename metadata to be C++ classes
Co-authored-by: Stefan Karlsson <stefan.karlsson@oracle.com>
Co-authored-by: Mikael Gerdin <mikael.gerdin@oracle.com>
Co-authored-by: Tom Rodriguez <tom.rodriguez@oracle.com>
Reviewed-by: jmasa, stefank, never, coleenp, kvn, brutisso, mgerdin, dholmes, jrose, twisti, roland
2012-09-01 13:25:18 -04:00
|
|
|
#define CLASSLOADER_INJECTED_FIELDS(macro) \
|
2012-11-29 16:50:29 -05:00
|
|
|
macro(java_lang_ClassLoader, loader_data, intptr_signature, false)
|
6964458: Reimplement class meta-data storage to use native memory
Remove PermGen, allocate meta-data in metaspace linked to class loaders, rewrite GC walking, rewrite and rename metadata to be C++ classes
Co-authored-by: Stefan Karlsson <stefan.karlsson@oracle.com>
Co-authored-by: Mikael Gerdin <mikael.gerdin@oracle.com>
Co-authored-by: Tom Rodriguez <tom.rodriguez@oracle.com>
Reviewed-by: jmasa, stefank, never, coleenp, kvn, brutisso, mgerdin, dholmes, jrose, twisti, roland
2012-09-01 13:25:18 -04:00
|
|
|
|
2007-12-01 00:00:00 +00:00
|
|
|
class java_lang_ClassLoader : AllStatic {
|
|
|
|
private:
|
6964458: Reimplement class meta-data storage to use native memory
Remove PermGen, allocate meta-data in metaspace linked to class loaders, rewrite GC walking, rewrite and rename metadata to be C++ classes
Co-authored-by: Stefan Karlsson <stefan.karlsson@oracle.com>
Co-authored-by: Mikael Gerdin <mikael.gerdin@oracle.com>
Co-authored-by: Tom Rodriguez <tom.rodriguez@oracle.com>
Reviewed-by: jmasa, stefank, never, coleenp, kvn, brutisso, mgerdin, dholmes, jrose, twisti, roland
2012-09-01 13:25:18 -04:00
|
|
|
// The fake offsets are added by the class loader when java.lang.Class is loaded
|
2007-12-01 00:00:00 +00:00
|
|
|
enum {
|
|
|
|
hc_parent_offset = 0
|
|
|
|
};
|
6964458: Reimplement class meta-data storage to use native memory
Remove PermGen, allocate meta-data in metaspace linked to class loaders, rewrite GC walking, rewrite and rename metadata to be C++ classes
Co-authored-by: Stefan Karlsson <stefan.karlsson@oracle.com>
Co-authored-by: Mikael Gerdin <mikael.gerdin@oracle.com>
Co-authored-by: Tom Rodriguez <tom.rodriguez@oracle.com>
Reviewed-by: jmasa, stefank, never, coleenp, kvn, brutisso, mgerdin, dholmes, jrose, twisti, roland
2012-09-01 13:25:18 -04:00
|
|
|
static int _loader_data_offset;
|
2011-09-10 17:29:02 -07:00
|
|
|
static bool offsets_computed;
|
2007-12-01 00:00:00 +00:00
|
|
|
static int parent_offset;
|
2011-09-10 17:29:02 -07:00
|
|
|
static int parallelCapable_offset;
|
|
|
|
|
6964458: Reimplement class meta-data storage to use native memory
Remove PermGen, allocate meta-data in metaspace linked to class loaders, rewrite GC walking, rewrite and rename metadata to be C++ classes
Co-authored-by: Stefan Karlsson <stefan.karlsson@oracle.com>
Co-authored-by: Mikael Gerdin <mikael.gerdin@oracle.com>
Co-authored-by: Tom Rodriguez <tom.rodriguez@oracle.com>
Reviewed-by: jmasa, stefank, never, coleenp, kvn, brutisso, mgerdin, dholmes, jrose, twisti, roland
2012-09-01 13:25:18 -04:00
|
|
|
public:
|
2011-09-10 17:29:02 -07:00
|
|
|
static void compute_offsets();
|
2007-12-01 00:00:00 +00:00
|
|
|
|
6964458: Reimplement class meta-data storage to use native memory
Remove PermGen, allocate meta-data in metaspace linked to class loaders, rewrite GC walking, rewrite and rename metadata to be C++ classes
Co-authored-by: Stefan Karlsson <stefan.karlsson@oracle.com>
Co-authored-by: Mikael Gerdin <mikael.gerdin@oracle.com>
Co-authored-by: Tom Rodriguez <tom.rodriguez@oracle.com>
Reviewed-by: jmasa, stefank, never, coleenp, kvn, brutisso, mgerdin, dholmes, jrose, twisti, roland
2012-09-01 13:25:18 -04:00
|
|
|
static ClassLoaderData** loader_data_addr(oop loader);
|
|
|
|
static ClassLoaderData* loader_data(oop loader);
|
|
|
|
|
2007-12-01 00:00:00 +00:00
|
|
|
static oop parent(oop loader);
|
2012-07-24 10:51:00 -07:00
|
|
|
static bool isAncestor(oop loader, oop cl);
|
2007-12-01 00:00:00 +00:00
|
|
|
|
2011-09-10 17:29:02 -07:00
|
|
|
// Support for parallelCapable field
|
|
|
|
static bool parallelCapable(oop the_class_mirror);
|
|
|
|
|
2007-12-01 00:00:00 +00:00
|
|
|
static bool is_trusted_loader(oop loader);
|
|
|
|
|
|
|
|
// Fix for 4474172
|
|
|
|
static oop non_reflection_class_loader(oop loader);
|
|
|
|
|
2012-07-24 10:51:00 -07:00
|
|
|
// Testers
|
6964458: Reimplement class meta-data storage to use native memory
Remove PermGen, allocate meta-data in metaspace linked to class loaders, rewrite GC walking, rewrite and rename metadata to be C++ classes
Co-authored-by: Stefan Karlsson <stefan.karlsson@oracle.com>
Co-authored-by: Mikael Gerdin <mikael.gerdin@oracle.com>
Co-authored-by: Tom Rodriguez <tom.rodriguez@oracle.com>
Reviewed-by: jmasa, stefank, never, coleenp, kvn, brutisso, mgerdin, dholmes, jrose, twisti, roland
2012-09-01 13:25:18 -04:00
|
|
|
static bool is_subclass(Klass* klass) {
|
2012-11-12 16:15:05 -05:00
|
|
|
return klass->is_subclass_of(SystemDictionary::ClassLoader_klass());
|
2012-07-24 10:51:00 -07:00
|
|
|
}
|
2015-02-13 14:37:35 +01:00
|
|
|
static bool is_instance(oop obj);
|
2012-07-24 10:51:00 -07:00
|
|
|
|
2007-12-01 00:00:00 +00:00
|
|
|
// Debugging
|
|
|
|
friend class JavaClasses;
|
6964458: Reimplement class meta-data storage to use native memory
Remove PermGen, allocate meta-data in metaspace linked to class loaders, rewrite GC walking, rewrite and rename metadata to be C++ classes
Co-authored-by: Stefan Karlsson <stefan.karlsson@oracle.com>
Co-authored-by: Mikael Gerdin <mikael.gerdin@oracle.com>
Co-authored-by: Tom Rodriguez <tom.rodriguez@oracle.com>
Reviewed-by: jmasa, stefank, never, coleenp, kvn, brutisso, mgerdin, dholmes, jrose, twisti, roland
2012-09-01 13:25:18 -04:00
|
|
|
friend class ClassFileParser; // access to number_of_fake_fields
|
2007-12-01 00:00:00 +00:00
|
|
|
};
|
|
|
|
|
|
|
|
|
|
|
|
// Interface to java.lang.System objects
|
|
|
|
|
|
|
|
class java_lang_System : AllStatic {
|
|
|
|
private:
|
|
|
|
enum {
|
|
|
|
hc_static_in_offset = 0,
|
|
|
|
hc_static_out_offset = 1,
|
2013-04-05 10:18:36 -04:00
|
|
|
hc_static_err_offset = 2,
|
|
|
|
hc_static_security_offset = 3
|
2007-12-01 00:00:00 +00:00
|
|
|
};
|
|
|
|
|
|
|
|
static int static_in_offset;
|
|
|
|
static int static_out_offset;
|
|
|
|
static int static_err_offset;
|
2013-04-05 10:18:36 -04:00
|
|
|
static int static_security_offset;
|
2007-12-01 00:00:00 +00:00
|
|
|
|
|
|
|
public:
|
|
|
|
static int in_offset_in_bytes();
|
|
|
|
static int out_offset_in_bytes();
|
|
|
|
static int err_offset_in_bytes();
|
|
|
|
|
2013-04-05 10:18:36 -04:00
|
|
|
static bool has_security_manager();
|
|
|
|
|
2007-12-01 00:00:00 +00:00
|
|
|
// Debugging
|
|
|
|
friend class JavaClasses;
|
|
|
|
};
|
|
|
|
|
|
|
|
|
|
|
|
// Interface to java.lang.StackTraceElement objects
|
|
|
|
|
|
|
|
class java_lang_StackTraceElement: AllStatic {
|
|
|
|
private:
|
|
|
|
enum {
|
|
|
|
hc_declaringClass_offset = 0,
|
|
|
|
hc_methodName_offset = 1,
|
|
|
|
hc_fileName_offset = 2,
|
|
|
|
hc_lineNumber_offset = 3
|
|
|
|
};
|
|
|
|
|
|
|
|
static int declaringClass_offset;
|
|
|
|
static int methodName_offset;
|
|
|
|
static int fileName_offset;
|
|
|
|
static int lineNumber_offset;
|
|
|
|
|
|
|
|
public:
|
|
|
|
// Setters
|
|
|
|
static void set_declaringClass(oop element, oop value);
|
|
|
|
static void set_methodName(oop element, oop value);
|
|
|
|
static void set_fileName(oop element, oop value);
|
|
|
|
static void set_lineNumber(oop element, int value);
|
|
|
|
|
|
|
|
// Create an instance of StackTraceElement
|
2015-03-20 02:44:51 -07:00
|
|
|
static oop create(Handle mirror, int method, int version, int bci, int cpref, TRAPS);
|
2015-10-23 16:48:38 -04:00
|
|
|
static oop create(const methodHandle& method, int bci, TRAPS);
|
2007-12-01 00:00:00 +00:00
|
|
|
|
|
|
|
// Debugging
|
|
|
|
friend class JavaClasses;
|
|
|
|
};
|
|
|
|
|
|
|
|
|
|
|
|
// Interface to java.lang.AssertionStatusDirectives objects
|
|
|
|
|
|
|
|
class java_lang_AssertionStatusDirectives: AllStatic {
|
|
|
|
private:
|
|
|
|
enum {
|
|
|
|
hc_classes_offset,
|
|
|
|
hc_classEnabled_offset,
|
|
|
|
hc_packages_offset,
|
|
|
|
hc_packageEnabled_offset,
|
|
|
|
hc_deflt_offset
|
|
|
|
};
|
|
|
|
|
|
|
|
static int classes_offset;
|
|
|
|
static int classEnabled_offset;
|
|
|
|
static int packages_offset;
|
|
|
|
static int packageEnabled_offset;
|
|
|
|
static int deflt_offset;
|
|
|
|
|
|
|
|
public:
|
|
|
|
// Setters
|
|
|
|
static void set_classes(oop obj, oop val);
|
|
|
|
static void set_classEnabled(oop obj, oop val);
|
|
|
|
static void set_packages(oop obj, oop val);
|
|
|
|
static void set_packageEnabled(oop obj, oop val);
|
|
|
|
static void set_deflt(oop obj, bool val);
|
|
|
|
// Debugging
|
|
|
|
friend class JavaClasses;
|
|
|
|
};
|
|
|
|
|
|
|
|
|
|
|
|
class java_nio_Buffer: AllStatic {
|
|
|
|
private:
|
|
|
|
static int _limit_offset;
|
|
|
|
|
|
|
|
public:
|
|
|
|
static int limit_offset();
|
|
|
|
static void compute_offsets();
|
|
|
|
};
|
|
|
|
|
|
|
|
class java_util_concurrent_locks_AbstractOwnableSynchronizer : AllStatic {
|
|
|
|
private:
|
|
|
|
static int _owner_offset;
|
|
|
|
public:
|
|
|
|
static void initialize(TRAPS);
|
|
|
|
static oop get_owner_threadObj(oop obj);
|
|
|
|
};
|
|
|
|
|
2011-09-10 17:29:02 -07:00
|
|
|
// Use to declare fields that need to be injected into Java classes
|
|
|
|
// for the JVM to use. The name_index and signature_index are
|
|
|
|
// declared in vmSymbols. The may_be_java flag is used to declare
|
|
|
|
// fields that might already exist in Java but should be injected if
|
|
|
|
// they don't. Otherwise the field is unconditionally injected and
|
|
|
|
// the JVM uses the injected one. This is to ensure that name
|
|
|
|
// collisions don't occur. In general may_be_java should be false
|
|
|
|
// unless there's a good reason.
|
|
|
|
|
|
|
|
class InjectedField {
|
|
|
|
public:
|
|
|
|
const SystemDictionary::WKID klass_id;
|
|
|
|
const vmSymbols::SID name_index;
|
|
|
|
const vmSymbols::SID signature_index;
|
|
|
|
const bool may_be_java;
|
|
|
|
|
|
|
|
|
6964458: Reimplement class meta-data storage to use native memory
Remove PermGen, allocate meta-data in metaspace linked to class loaders, rewrite GC walking, rewrite and rename metadata to be C++ classes
Co-authored-by: Stefan Karlsson <stefan.karlsson@oracle.com>
Co-authored-by: Mikael Gerdin <mikael.gerdin@oracle.com>
Co-authored-by: Tom Rodriguez <tom.rodriguez@oracle.com>
Reviewed-by: jmasa, stefank, never, coleenp, kvn, brutisso, mgerdin, dholmes, jrose, twisti, roland
2012-09-01 13:25:18 -04:00
|
|
|
Klass* klass() const { return SystemDictionary::well_known_klass(klass_id); }
|
2011-09-10 17:29:02 -07:00
|
|
|
Symbol* name() const { return lookup_symbol(name_index); }
|
|
|
|
Symbol* signature() const { return lookup_symbol(signature_index); }
|
|
|
|
|
|
|
|
int compute_offset();
|
|
|
|
|
|
|
|
// Find the Symbol for this index
|
|
|
|
static Symbol* lookup_symbol(int symbol_index) {
|
|
|
|
return vmSymbols::symbol_at((vmSymbols::SID)symbol_index);
|
|
|
|
}
|
|
|
|
};
|
|
|
|
|
|
|
|
#define DECLARE_INJECTED_FIELD_ENUM(klass, name, signature, may_be_java) \
|
|
|
|
klass##_##name##_enum,
|
|
|
|
|
|
|
|
#define ALL_INJECTED_FIELDS(macro) \
|
|
|
|
CLASS_INJECTED_FIELDS(macro) \
|
6964458: Reimplement class meta-data storage to use native memory
Remove PermGen, allocate meta-data in metaspace linked to class loaders, rewrite GC walking, rewrite and rename metadata to be C++ classes
Co-authored-by: Stefan Karlsson <stefan.karlsson@oracle.com>
Co-authored-by: Mikael Gerdin <mikael.gerdin@oracle.com>
Co-authored-by: Tom Rodriguez <tom.rodriguez@oracle.com>
Reviewed-by: jmasa, stefank, never, coleenp, kvn, brutisso, mgerdin, dholmes, jrose, twisti, roland
2012-09-01 13:25:18 -04:00
|
|
|
CLASSLOADER_INJECTED_FIELDS(macro) \
|
2015-05-15 19:23:11 +03:00
|
|
|
MEMBERNAME_INJECTED_FIELDS(macro) \
|
|
|
|
CALLSITECONTEXT_INJECTED_FIELDS(macro)
|
2011-09-10 17:29:02 -07:00
|
|
|
|
2007-12-01 00:00:00 +00:00
|
|
|
// Interface to hard-coded offset checking
|
|
|
|
|
|
|
|
class JavaClasses : AllStatic {
|
|
|
|
private:
|
2011-09-10 17:29:02 -07:00
|
|
|
|
|
|
|
static InjectedField _injected_fields[];
|
|
|
|
|
2007-12-01 00:00:00 +00:00
|
|
|
static bool check_offset(const char *klass_name, int offset, const char *field_name, const char* field_sig) PRODUCT_RETURN0;
|
|
|
|
static bool check_static_offset(const char *klass_name, int hardcoded_offset, const char *field_name, const char* field_sig) PRODUCT_RETURN0;
|
2008-04-29 19:45:22 -07:00
|
|
|
static bool check_constant(const char *klass_name, int constant, const char *field_name, const char* field_sig) PRODUCT_RETURN0;
|
2011-09-10 17:29:02 -07:00
|
|
|
|
2007-12-01 00:00:00 +00:00
|
|
|
public:
|
2011-09-10 17:29:02 -07:00
|
|
|
enum InjectedFieldID {
|
|
|
|
ALL_INJECTED_FIELDS(DECLARE_INJECTED_FIELD_ENUM)
|
|
|
|
MAX_enum
|
|
|
|
};
|
|
|
|
|
|
|
|
static int compute_injected_offset(InjectedFieldID id);
|
|
|
|
|
2007-12-01 00:00:00 +00:00
|
|
|
static void compute_hard_coded_offsets();
|
|
|
|
static void compute_offsets();
|
|
|
|
static void check_offsets() PRODUCT_RETURN;
|
2011-09-10 17:29:02 -07:00
|
|
|
|
|
|
|
static InjectedField* get_injected(Symbol* class_name, int* field_count);
|
2007-12-01 00:00:00 +00:00
|
|
|
};
|
2010-11-23 13:22:55 -08:00
|
|
|
|
2011-09-10 17:29:02 -07:00
|
|
|
#undef DECLARE_INJECTED_FIELD_ENUM
|
|
|
|
|
2010-11-23 13:22:55 -08:00
|
|
|
#endif // SHARE_VM_CLASSFILE_JAVACLASSES_HPP
|