Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
openanolis
dragonwell8_hotspot
提交
b279dac8
D
dragonwell8_hotspot
项目概览
openanolis
/
dragonwell8_hotspot
通知
2
Star
2
Fork
0
代码
文件
提交
分支
Tags
贡献者
分支图
Diff
Issue
0
列表
看板
标记
里程碑
合并请求
0
Wiki
0
Wiki
分析
仓库
DevOps
项目成员
Pages
D
dragonwell8_hotspot
项目概览
项目概览
详情
发布
仓库
仓库
文件
提交
分支
标签
贡献者
分支图
比较
Issue
0
Issue
0
列表
看板
标记
里程碑
合并请求
0
合并请求
0
Pages
分析
分析
仓库分析
DevOps
Wiki
0
Wiki
成员
成员
收起侧边栏
关闭侧边栏
动态
分支图
创建新Issue
提交
Issue看板
提交
b279dac8
编写于
5月 02, 2008
作者:
S
sbohne
浏览文件
操作
浏览文件
下载
差异文件
Merge
上级
ace3ee88
7da08106
变更
11
展开全部
隐藏空白更改
内联
并排
Showing
11 changed file
with
625 addition
and
626 deletion
+625
-626
agent/src/share/classes/sun/jvm/hotspot/memory/SystemDictionary.java
...hare/classes/sun/jvm/hotspot/memory/SystemDictionary.java
+27
-13
src/share/vm/classfile/javaClasses.cpp
src/share/vm/classfile/javaClasses.cpp
+172
-137
src/share/vm/classfile/javaClasses.hpp
src/share/vm/classfile/javaClasses.hpp
+11
-4
src/share/vm/classfile/systemDictionary.cpp
src/share/vm/classfile/systemDictionary.cpp
+150
-225
src/share/vm/classfile/systemDictionary.hpp
src/share/vm/classfile/systemDictionary.hpp
+150
-145
src/share/vm/opto/divnode.cpp
src/share/vm/opto/divnode.cpp
+39
-64
src/share/vm/opto/parse2.cpp
src/share/vm/opto/parse2.cpp
+13
-4
src/share/vm/runtime/globals.hpp
src/share/vm/runtime/globals.hpp
+3
-0
src/share/vm/runtime/vmStructs.cpp
src/share/vm/runtime/vmStructs.cpp
+8
-34
src/share/vm/services/threadService.cpp
src/share/vm/services/threadService.cpp
+1
-0
test/compiler/6646019/Test.java
test/compiler/6646019/Test.java
+51
-0
未找到文件。
agent/src/share/classes/sun/jvm/hotspot/memory/SystemDictionary.java
浏览文件 @
b279dac8
...
...
@@ -29,21 +29,27 @@ import sun.jvm.hotspot.debugger.*;
import
sun.jvm.hotspot.oops.*
;
import
sun.jvm.hotspot.runtime.*
;
import
sun.jvm.hotspot.types.*
;
import
sun.jvm.hotspot.types.OopField
;
// resolve ambiguity with oops.OopField
// following needed for on-the-fly field construction:
import
sun.jvm.hotspot.types.basic.BasicOopField
;
import
sun.jvm.hotspot.types.basic.BasicTypeDataBase
;
public
class
SystemDictionary
{
private
static
AddressField
dictionaryField
;
private
static
AddressField
sharedDictionaryField
;
private
static
AddressField
placeholdersField
;
private
static
AddressField
loaderConstraintTableField
;
private
static
sun
.
jvm
.
hotspot
.
types
.
OopField
javaSystemLoaderField
;
private
static
OopField
javaSystemLoaderField
;
private
static
int
nofBuckets
;
private
static
sun
.
jvm
.
hotspot
.
types
.
OopField
objectKlassField
;
private
static
sun
.
jvm
.
hotspot
.
types
.
OopField
classLoaderKlassField
;
private
static
sun
.
jvm
.
hotspot
.
types
.
OopField
stringKlassField
;
private
static
sun
.
jvm
.
hotspot
.
types
.
OopField
systemKlassField
;
private
static
sun
.
jvm
.
hotspot
.
types
.
OopField
threadKlassField
;
private
static
sun
.
jvm
.
hotspot
.
types
.
OopField
threadGroupKlassField
;
private
static
OopField
wellKnownKlasses
;
private
static
OopField
objectKlassField
;
private
static
OopField
classLoaderKlassField
;
private
static
OopField
stringKlassField
;
private
static
OopField
systemKlassField
;
private
static
OopField
threadKlassField
;
private
static
OopField
threadGroupKlassField
;
static
{
VM
.
registerVMInitializedObserver
(
new
Observer
()
{
...
...
@@ -63,12 +69,20 @@ public class SystemDictionary {
javaSystemLoaderField
=
type
.
getOopField
(
"_java_system_loader"
);
nofBuckets
=
db
.
lookupIntConstant
(
"SystemDictionary::_nof_buckets"
).
intValue
();
objectKlassField
=
type
.
getOopField
(
"_object_klass"
);
classLoaderKlassField
=
type
.
getOopField
(
"_classloader_klass"
);
stringKlassField
=
type
.
getOopField
(
"_string_klass"
);
systemKlassField
=
type
.
getOopField
(
"_system_klass"
);
threadKlassField
=
type
.
getOopField
(
"_thread_klass"
);
threadGroupKlassField
=
type
.
getOopField
(
"_threadGroup_klass"
);
wellKnownKlasses
=
type
.
getOopField
(
"_well_known_klasses[0]"
);
objectKlassField
=
findWellKnownKlass
(
"object_klass"
,
type
,
db
);
classLoaderKlassField
=
findWellKnownKlass
(
"classloader_klass"
,
type
,
db
);
stringKlassField
=
findWellKnownKlass
(
"string_klass"
,
type
,
db
);
systemKlassField
=
findWellKnownKlass
(
"system_klass"
,
type
,
db
);
threadKlassField
=
findWellKnownKlass
(
"thread_klass"
,
type
,
db
);
threadGroupKlassField
=
findWellKnownKlass
(
"threadGroup_klass"
,
type
,
db
);
}
private
static
OopField
findWellKnownKlass
(
String
indexName
,
Type
type
,
TypeDataBase
db
)
{
Address
wkk
=
wellKnownKlasses
.
getStaticFieldAddress
();
int
index
=
db
.
lookupIntConstant
(
"SystemDictionary::#"
+
indexName
).
intValue
();
return
new
BasicOopField
((
BasicTypeDataBase
)
db
,
type
,
indexName
,
type
,
true
,
index
*
db
.
getAddressSize
(),
wkk
);
}
public
Dictionary
dictionary
()
{
...
...
src/share/vm/classfile/javaClasses.cpp
浏览文件 @
b279dac8
此差异已折叠。
点击以展开。
src/share/vm/classfile/javaClasses.hpp
浏览文件 @
b279dac8
...
...
@@ -45,9 +45,9 @@ class java_lang_String : AllStatic {
private:
enum
{
hc_value_offset
=
0
,
hc_offset_offset
=
1
,
hc_count_offset
=
2
,
hc_hash_offset
=
3
hc_offset_offset
=
1
//hc_count_offset = 2 -- not a word-scaled offset
//hc_hash_offset = 3 -- not a word-scaled offset
};
static
int
value_offset
;
...
...
@@ -149,6 +149,9 @@ class java_lang_Class : AllStatic {
// Conversion
static
klassOop
as_klassOop
(
oop
java_class
);
// Testing
static
bool
is_instance
(
oop
obj
)
{
return
obj
!=
NULL
&&
obj
->
klass
()
==
SystemDictionary
::
class_klass
();
}
static
bool
is_primitive
(
oop
java_class
);
static
BasicType
primitive_type
(
oop
java_class
);
static
oop
primitive_mirror
(
BasicType
t
);
...
...
@@ -651,13 +654,16 @@ class java_lang_boxing_object: AllStatic {
};
static
int
value_offset
;
static
oop
initialize_and_allocate
(
klassOop
klass
,
TRAPS
);
static
oop
initialize_and_allocate
(
BasicType
type
,
TRAPS
);
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
);
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
;
}
static
int
value_offset_in_bytes
()
{
return
value_offset
;
}
...
...
@@ -921,6 +927,7 @@ class JavaClasses : AllStatic {
private:
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
;
static
bool
check_constant
(
const
char
*
klass_name
,
int
constant
,
const
char
*
field_name
,
const
char
*
field_sig
)
PRODUCT_RETURN0
;
public:
static
void
compute_hard_coded_offsets
();
static
void
compute_offsets
();
...
...
src/share/vm/classfile/systemDictionary.cpp
浏览文件 @
b279dac8
此差异已折叠。
点击以展开。
src/share/vm/classfile/systemDictionary.hpp
浏览文件 @
b279dac8
...
...
@@ -64,12 +64,133 @@ class LoaderConstraintTable;
class
HashtableBucket
;
class
ResolutionErrorTable
;
// Certain classes are preloaded, such as java.lang.Object and java.lang.String.
// They are all "well-known", in the sense that no class loader is allowed
// to provide a different definition.
//
// These klasses must all have names defined in vmSymbols.
#define WK_KLASS_ENUM_NAME(kname) kname##_knum
// Each well-known class has a short klass name (like object_klass),
// a vmSymbol name (like java_lang_Object), and a flag word
// that makes some minor distinctions, like whether the klass
// is preloaded, optional, release-specific, etc.
// The order of these definitions is significant; it is the order in which
// preloading is actually performed by initialize_preloaded_classes.
#define WK_KLASSES_DO(template) \
/* well-known classes */
\
template(object_klass, java_lang_Object, Pre) \
template(string_klass, java_lang_String, Pre) \
template(class_klass, java_lang_Class, Pre) \
template(cloneable_klass, java_lang_Cloneable, Pre) \
template(classloader_klass, java_lang_ClassLoader, Pre) \
template(serializable_klass, java_io_Serializable, Pre) \
template(system_klass, java_lang_System, Pre) \
template(throwable_klass, java_lang_Throwable, Pre) \
template(error_klass, java_lang_Error, Pre) \
template(threaddeath_klass, java_lang_ThreadDeath, Pre) \
template(exception_klass, java_lang_Exception, Pre) \
template(runtime_exception_klass, java_lang_RuntimeException, Pre) \
template(protectionDomain_klass, java_security_ProtectionDomain, Pre) \
template(AccessControlContext_klass, java_security_AccessControlContext, Pre) \
template(classNotFoundException_klass, java_lang_ClassNotFoundException, Pre) \
template(noClassDefFoundError_klass, java_lang_NoClassDefFoundError, Pre) \
template(linkageError_klass, java_lang_LinkageError, Pre) \
template(ClassCastException_klass, java_lang_ClassCastException, Pre) \
template(ArrayStoreException_klass, java_lang_ArrayStoreException, Pre) \
template(virtualMachineError_klass, java_lang_VirtualMachineError, Pre) \
template(OutOfMemoryError_klass, java_lang_OutOfMemoryError, Pre) \
template(StackOverflowError_klass, java_lang_StackOverflowError, Pre) \
template(IllegalMonitorStateException_klass, java_lang_IllegalMonitorStateException, Pre) \
template(reference_klass, java_lang_ref_Reference, Pre) \
\
/* Preload ref klasses and set reference types */
\
template(soft_reference_klass, java_lang_ref_SoftReference, Pre) \
template(weak_reference_klass, java_lang_ref_WeakReference, Pre) \
template(final_reference_klass, java_lang_ref_FinalReference, Pre) \
template(phantom_reference_klass, java_lang_ref_PhantomReference, Pre) \
template(finalizer_klass, java_lang_ref_Finalizer, Pre) \
\
template(thread_klass, java_lang_Thread, Pre) \
template(threadGroup_klass, java_lang_ThreadGroup, Pre) \
template(properties_klass, java_util_Properties, Pre) \
template(reflect_accessible_object_klass, java_lang_reflect_AccessibleObject, Pre) \
template(reflect_field_klass, java_lang_reflect_Field, Pre) \
template(reflect_method_klass, java_lang_reflect_Method, Pre) \
template(reflect_constructor_klass, java_lang_reflect_Constructor, Pre) \
\
/* NOTE: needed too early in bootstrapping process to have checks based on JDK version */
\
/* Universe::is_gte_jdk14x_version() is not set up by this point. */
\
/* It's okay if this turns out to be NULL in non-1.4 JDKs. */
\
template(reflect_magic_klass, sun_reflect_MagicAccessorImpl, Opt) \
template(reflect_method_accessor_klass, sun_reflect_MethodAccessorImpl, Opt_Only_JDK14NewRef) \
template(reflect_constructor_accessor_klass, sun_reflect_ConstructorAccessorImpl, Opt_Only_JDK14NewRef) \
template(reflect_delegating_classloader_klass, sun_reflect_DelegatingClassLoader, Opt) \
template(reflect_constant_pool_klass, sun_reflect_ConstantPool, Opt_Only_JDK15) \
template(reflect_unsafe_static_field_accessor_impl_klass, sun_reflect_UnsafeStaticFieldAccessorImpl, Opt_Only_JDK15) \
\
template(vector_klass, java_util_Vector, Pre) \
template(hashtable_klass, java_util_Hashtable, Pre) \
template(stringBuffer_klass, java_lang_StringBuffer, Pre) \
\
/* It's NULL in non-1.4 JDKs. */
\
template(stackTraceElement_klass, java_lang_StackTraceElement, Opt) \
/* Universe::is_gte_jdk14x_version() is not set up by this point. */
\
/* It's okay if this turns out to be NULL in non-1.4 JDKs. */
\
template(java_nio_Buffer_klass, java_nio_Buffer, Opt) \
\
/* If this class isn't present, it won't be referenced. */
\
template(sun_misc_AtomicLongCSImpl_klass, sun_misc_AtomicLongCSImpl, Opt) \
\
template(sun_jkernel_DownloadManager_klass, sun_jkernel_DownloadManager, Opt_Kernel) \
\
/* Preload boxing klasses */
\
template(boolean_klass, java_lang_Boolean, Pre) \
template(char_klass, java_lang_Character, Pre) \
template(float_klass, java_lang_Float, Pre) \
template(double_klass, java_lang_Double, Pre) \
template(byte_klass, java_lang_Byte, Pre) \
template(short_klass, java_lang_Short, Pre) \
template(int_klass, java_lang_Integer, Pre) \
template(long_klass, java_lang_Long, Pre) \
/*end*/
class
SystemDictionary
:
AllStatic
{
friend
class
VMStructs
;
friend
class
CompactingPermGenGen
;
NOT_PRODUCT
(
friend
class
instanceKlassKlass
;)
public:
enum
WKID
{
NO_WKID
=
0
,
#define WK_KLASS_ENUM(name, ignore_s, ignore_o) WK_KLASS_ENUM_NAME(name),
WK_KLASSES_DO
(
WK_KLASS_ENUM
)
#undef WK_KLASS_ENUM
WKID_LIMIT
,
FIRST_WKID
=
NO_WKID
+
1
};
enum
InitOption
{
Pre
,
// preloaded; error if not present
// Order is significant. Options before this point require resolve_or_fail.
// Options after this point will use resolve_or_null instead.
Opt
,
// preload tried; NULL if not present
Opt_Only_JDK14NewRef
,
// preload tried; use only with NewReflection
Opt_Only_JDK15
,
// preload tried; use only with JDK1.5+
Opt_Kernel
,
// preload tried only #ifdef KERNEL
OPTION_LIMIT
,
CEIL_LG_OPTION_LIMIT
=
4
// OPTION_LIMIT <= (1<<CEIL_LG_OPTION_LIMIT)
};
// Returns a class with a given class name and class loader. Loads the
// class if needed. If not found a NoClassDefFoundError or a
// ClassNotFoundException is thrown, depending on the value on the
...
...
@@ -123,6 +244,9 @@ public:
Handle
protection_domain
,
TRAPS
);
// If the given name is known to vmSymbols, return the well-know klass:
static
klassOop
find_well_known_klass
(
symbolOop
class_name
);
// Lookup an instance or array class that has already been loaded
// either into the given class loader, or else into another class
// loader that is constrained (via loader constraints) to produce
...
...
@@ -235,85 +359,34 @@ public:
return
k
;
}
public:
static
klassOop
object_klass
()
{
return
check_klass
(
_object_klass
);
}
static
klassOop
string_klass
()
{
return
check_klass
(
_string_klass
);
}
static
klassOop
class_klass
()
{
return
check_klass
(
_class_klass
);
}
static
klassOop
cloneable_klass
()
{
return
check_klass
(
_cloneable_klass
);
}
static
klassOop
classloader_klass
()
{
return
check_klass
(
_classloader_klass
);
}
static
klassOop
serializable_klass
()
{
return
check_klass
(
_serializable_klass
);
}
static
klassOop
system_klass
()
{
return
check_klass
(
_system_klass
);
}
static
klassOop
throwable_klass
()
{
return
check_klass
(
_throwable_klass
);
}
static
klassOop
error_klass
()
{
return
check_klass
(
_error_klass
);
}
static
klassOop
threaddeath_klass
()
{
return
check_klass
(
_threaddeath_klass
);
}
static
klassOop
exception_klass
()
{
return
check_klass
(
_exception_klass
);
}
static
klassOop
runtime_exception_klass
()
{
return
check_klass
(
_runtime_exception_klass
);
}
static
klassOop
classNotFoundException_klass
()
{
return
check_klass
(
_classNotFoundException_klass
);
}
static
klassOop
noClassDefFoundError_klass
()
{
return
check_klass
(
_noClassDefFoundError_klass
);
}
static
klassOop
linkageError_klass
()
{
return
check_klass
(
_linkageError_klass
);
}
static
klassOop
ClassCastException_klass
()
{
return
check_klass
(
_classCastException_klass
);
}
static
klassOop
ArrayStoreException_klass
()
{
return
check_klass
(
_arrayStoreException_klass
);
}
static
klassOop
virtualMachineError_klass
()
{
return
check_klass
(
_virtualMachineError_klass
);
}
static
klassOop
OutOfMemoryError_klass
()
{
return
check_klass
(
_outOfMemoryError_klass
);
}
static
klassOop
StackOverflowError_klass
()
{
return
check_klass
(
_StackOverflowError_klass
);
}
static
klassOop
IllegalMonitorStateException_klass
()
{
return
check_klass
(
_illegalMonitorStateException_klass
);
}
static
klassOop
protectionDomain_klass
()
{
return
check_klass
(
_protectionDomain_klass
);
}
static
klassOop
AccessControlContext_klass
()
{
return
check_klass
(
_AccessControlContext_klass
);
}
static
klassOop
reference_klass
()
{
return
check_klass
(
_reference_klass
);
}
static
klassOop
soft_reference_klass
()
{
return
check_klass
(
_soft_reference_klass
);
}
static
klassOop
weak_reference_klass
()
{
return
check_klass
(
_weak_reference_klass
);
}
static
klassOop
final_reference_klass
()
{
return
check_klass
(
_final_reference_klass
);
}
static
klassOop
phantom_reference_klass
()
{
return
check_klass
(
_phantom_reference_klass
);
}
static
klassOop
finalizer_klass
()
{
return
check_klass
(
_finalizer_klass
);
}
static
klassOop
thread_klass
()
{
return
check_klass
(
_thread_klass
);
}
static
klassOop
threadGroup_klass
()
{
return
check_klass
(
_threadGroup_klass
);
}
static
klassOop
properties_klass
()
{
return
check_klass
(
_properties_klass
);
}
static
klassOop
reflect_accessible_object_klass
()
{
return
check_klass
(
_reflect_accessible_object_klass
);
}
static
klassOop
reflect_field_klass
()
{
return
check_klass
(
_reflect_field_klass
);
}
static
klassOop
reflect_method_klass
()
{
return
check_klass
(
_reflect_method_klass
);
}
static
klassOop
reflect_constructor_klass
()
{
return
check_klass
(
_reflect_constructor_klass
);
}
static
klassOop
reflect_method_accessor_klass
()
{
assert
(
JDK_Version
::
is_gte_jdk14x_version
()
&&
UseNewReflection
,
"JDK 1.4 only"
);
return
check_klass
(
_reflect_method_accessor_klass
);
}
static
klassOop
reflect_constructor_accessor_klass
()
{
assert
(
JDK_Version
::
is_gte_jdk14x_version
()
&&
UseNewReflection
,
"JDK 1.4 only"
);
return
check_klass
(
_reflect_constructor_accessor_klass
);
}
// NOTE: needed too early in bootstrapping process to have checks based on JDK version
static
klassOop
reflect_magic_klass
()
{
return
_reflect_magic_klass
;
}
static
klassOop
reflect_delegating_classloader_klass
()
{
return
_reflect_delegating_classloader_klass
;
}
static
klassOop
reflect_constant_pool_klass
()
{
static
klassOop
check_klass_Pre
(
klassOop
k
)
{
return
check_klass
(
k
);
}
static
klassOop
check_klass_Opt
(
klassOop
k
)
{
return
k
;
}
static
klassOop
check_klass_Opt_Kernel
(
klassOop
k
)
{
return
k
;
}
//== Opt
static
klassOop
check_klass_Opt_Only_JDK15
(
klassOop
k
)
{
assert
(
JDK_Version
::
is_gte_jdk15x_version
(),
"JDK 1.5 only"
);
return
_reflect_constant_pool_klass
;
return
k
;
}
static
klassOop
reflect_unsafe_static_field_accessor_impl_klass
()
{
assert
(
JDK_Version
::
is_gte_jdk15x_version
(),
"JDK 1.5 only"
);
return
_reflect_unsafe_static_field_accessor_impl_klass
;
static
klassOop
check_klass_Opt_Only_JDK14NewRef
(
klassOop
k
)
{
assert
(
JDK_Version
::
is_gte_jdk14x_version
()
&&
UseNewReflection
,
"JDK 1.4 only"
);
// despite the optional loading, if you use this it must be present:
return
check_klass
(
k
);
}
static
klassOop
vector_klass
()
{
return
check_klass
(
_vector_klass
);
}
static
klassOop
hashtable_klass
()
{
return
check_klass
(
_hashtable_klass
);
}
static
klassOop
stringBuffer_klass
()
{
return
check_klass
(
_stringBuffer_klass
);
}
static
klassOop
stackTraceElement_klass
()
{
return
check_klass
(
_stackTraceElement_klass
);
}
static
klassOop
java_nio_Buffer_klass
()
{
return
check_klass
(
_java_nio_Buffer_klass
);
}
static
klassOop
sun_misc_AtomicLongCSImpl_klass
()
{
return
_sun_misc_AtomicLongCSImpl_klass
;
}
static
bool
initialize_wk_klass
(
WKID
id
,
int
init_opt
,
TRAPS
);
static
void
initialize_wk_klasses_until
(
WKID
limit_id
,
WKID
&
start_id
,
TRAPS
);
static
void
initialize_wk_klasses_through
(
WKID
end_id
,
WKID
&
start_id
,
TRAPS
)
{
int
limit
=
(
int
)
end_id
+
1
;
initialize_wk_klasses_until
((
WKID
)
limit
,
start_id
,
THREAD
);
}
// To support incremental JRE downloads (KERNEL JRE). Null if not present.
static
klassOop
sun_jkernel_DownloadManager_klass
()
{
return
_sun_jkernel_DownloadManager_klass
;
}
public:
#define WK_KLASS_DECLARE(name, ignore_symbol, option) \
static klassOop name() { return check_klass_##option(_well_known_klasses[WK_KLASS_ENUM_NAME(name)]); }
WK_KLASSES_DO
(
WK_KLASS_DECLARE
);
#undef WK_KLASS_DECLARE
static
klassOop
boolean_klass
()
{
return
check_klass
(
_boolean_klass
);
}
static
klassOop
char_klass
()
{
return
check_klass
(
_char_klass
);
}
static
klassOop
float_klass
()
{
return
check_klass
(
_float_klass
);
}
static
klassOop
double_klass
()
{
return
check_klass
(
_double_klass
);
}
static
klassOop
byte_klass
()
{
return
check_klass
(
_byte_klass
);
}
static
klassOop
short_klass
()
{
return
check_klass
(
_short_klass
);
}
static
klassOop
int_klass
()
{
return
check_klass
(
_int_klass
);
}
static
klassOop
long_klass
()
{
return
check_klass
(
_long_klass
);
}
// Local definition for direct access to the private array:
#define WK_KLASS(name) _well_known_klasses[WK_KLASS_ENUM_NAME(name)]
static
klassOop
box_klass
(
BasicType
t
)
{
assert
((
uint
)
t
<
T_VOID
+
1
,
"range check"
);
...
...
@@ -335,8 +408,8 @@ public:
// Tells whether ClassLoader.checkPackageAccess is present
static
bool
has_checkPackageAccess
()
{
return
_has_checkPackageAccess
;
}
static
bool
class_klass_loaded
()
{
return
_class_klass
!=
NULL
;
}
static
bool
cloneable_klass_loaded
()
{
return
_cloneable_klass
!=
NULL
;
}
static
bool
class_klass_loaded
()
{
return
WK_KLASS
(
class_klass
)
!=
NULL
;
}
static
bool
cloneable_klass_loaded
()
{
return
WK_KLASS
(
cloneable_klass
)
!=
NULL
;
}
// Returns default system loader
static
oop
java_system_loader
();
...
...
@@ -498,80 +571,12 @@ private:
instanceKlassHandle
k
,
Handle
loader
,
TRAPS
);
// Variables holding commonly used klasses (preloaded)
static
klassOop
_object_klass
;
static
klassOop
_string_klass
;
static
klassOop
_class_klass
;
static
klassOop
_cloneable_klass
;
static
klassOop
_classloader_klass
;
static
klassOop
_serializable_klass
;
static
klassOop
_system_klass
;
static
klassOop
_throwable_klass
;
static
klassOop
_error_klass
;
static
klassOop
_threaddeath_klass
;
static
klassOop
_exception_klass
;
static
klassOop
_runtime_exception_klass
;
static
klassOop
_classNotFoundException_klass
;
static
klassOop
_noClassDefFoundError_klass
;
static
klassOop
_linkageError_klass
;
static
klassOop
_classCastException_klass
;
static
klassOop
_arrayStoreException_klass
;
static
klassOop
_virtualMachineError_klass
;
static
klassOop
_outOfMemoryError_klass
;
static
klassOop
_StackOverflowError_klass
;
static
klassOop
_illegalMonitorStateException_klass
;
static
klassOop
_protectionDomain_klass
;
static
klassOop
_AccessControlContext_klass
;
static
klassOop
_reference_klass
;
static
klassOop
_soft_reference_klass
;
static
klassOop
_weak_reference_klass
;
static
klassOop
_final_reference_klass
;
static
klassOop
_phantom_reference_klass
;
static
klassOop
_finalizer_klass
;
static
klassOop
_thread_klass
;
static
klassOop
_threadGroup_klass
;
static
klassOop
_properties_klass
;
static
klassOop
_reflect_accessible_object_klass
;
static
klassOop
_reflect_field_klass
;
static
klassOop
_reflect_method_klass
;
static
klassOop
_reflect_constructor_klass
;
// 1.4 reflection implementation
static
klassOop
_reflect_magic_klass
;
static
klassOop
_reflect_method_accessor_klass
;
static
klassOop
_reflect_constructor_accessor_klass
;
static
klassOop
_reflect_delegating_classloader_klass
;
// 1.5 annotations implementation
static
klassOop
_reflect_constant_pool_klass
;
static
klassOop
_reflect_unsafe_static_field_accessor_impl_klass
;
static
klassOop
_stringBuffer_klass
;
static
klassOop
_vector_klass
;
static
klassOop
_hashtable_klass
;
static
klassOop
_stackTraceElement_klass
;
static
klassOop
_java_nio_Buffer_klass
;
static
klassOop
_sun_misc_AtomicLongCSImpl_klass
;
// KERNEL JRE support.
static
klassOop
_sun_jkernel_DownloadManager_klass
;
static
klassOop
_well_known_klasses
[];
// Lazily loaded klasses
static
volatile
klassOop
_abstract_ownable_synchronizer_klass
;
// Box klasses
static
klassOop
_boolean_klass
;
static
klassOop
_char_klass
;
static
klassOop
_float_klass
;
static
klassOop
_double_klass
;
static
klassOop
_byte_klass
;
static
klassOop
_short_klass
;
static
klassOop
_int_klass
;
static
klassOop
_long_klass
;
// table of same
// table of box klasses (int_klass, etc.)
static
klassOop
_box_klasses
[
T_VOID
+
1
];
static
oop
_java_system_loader
;
...
...
src/share/vm/opto/divnode.cpp
浏览文件 @
b279dac8
...
...
@@ -421,7 +421,7 @@ const Type *DivFNode::Value( PhaseTransform *phase ) const {
// x/x == 1, we ignore 0/0.
// Note: if t1 and t2 are zero then result is NaN (JVMS page 213)
//
d
oes not work for variables because of NaN's
//
D
oes not work for variables because of NaN's
if
(
phase
->
eqv
(
in
(
1
),
in
(
2
)
)
&&
t1
->
base
()
==
Type
::
FloatCon
)
if
(
!
g_isnan
(
t1
->
getf
())
&&
g_isfinite
(
t1
->
getf
())
&&
t1
->
getf
()
!=
0.0
)
// could be negative ZERO or NaN
return
TypeF
::
ONE
;
...
...
@@ -491,7 +491,7 @@ Node *DivFNode::Ideal(PhaseGVN *phase, bool can_reshape) {
//=============================================================================
//------------------------------Value------------------------------------------
// An DivDNode divides its inputs. The third input is a Control input, used to
// prvent hoisting the divide above an unsafe test.
// pr
e
vent hoisting the divide above an unsafe test.
const
Type
*
DivDNode
::
Value
(
PhaseTransform
*
phase
)
const
{
// Either input is TOP ==> the result is TOP
const
Type
*
t1
=
phase
->
type
(
in
(
1
)
);
...
...
@@ -872,56 +872,32 @@ const Type *ModFNode::Value( PhaseTransform *phase ) const {
(
t1
==
Type
::
BOTTOM
)
||
(
t2
==
Type
::
BOTTOM
)
)
return
bot
;
// If either is a NaN, return an input NaN
if
(
g_isnan
(
t1
->
getf
())
)
return
t1
;
if
(
g_isnan
(
t2
->
getf
())
)
return
t2
;
// If either number is not a constant, we know nothing.
if
((
t1
->
base
()
!=
Type
::
FloatCon
)
||
(
t2
->
base
()
!=
Type
::
FloatCon
))
{
return
Type
::
FLOAT
;
// note: x%x can be either NaN or 0
}
// It is not worth trying to constant fold this stuff!
return
Type
::
FLOAT
;
float
f1
=
t1
->
getf
();
float
f2
=
t2
->
getf
();
jint
x1
=
jint_cast
(
f1
);
// note: *(int*)&f1, not just (int)f1
jint
x2
=
jint_cast
(
f2
);
/*
// If dividend is infinity or divisor is zero, or both, the result is NaN
if( !g_isfinite(t1->getf()) || ((t2->getf() == 0.0) || (jint_cast(t2->getf()) == 0x80000000)) )
// X MOD infinity = X
if( !g_isfinite(t2->getf()) && !g_isnan(t2->getf()) ) return t1;
// 0 MOD finite = dividend (positive or negative zero)
// Not valid for: NaN MOD any; any MOD nan; 0 MOD 0; or for 0 MOD NaN
// NaNs are handled previously.
if( !(t2->getf() == 0.0) && !((int)t2->getf() == 0x80000000)) {
if (((t1->getf() == 0.0) || ((int)t1->getf() == 0x80000000)) && g_isfinite(t2->getf()) ) {
return t1;
}
}
// X MOD X is 0
// Does not work for variables because of NaN's
if( phase->eqv( in(1), in(2) ) && t1->base() == Type::FloatCon)
if (!g_isnan(t1->getf()) && (t1->getf() != 0.0) && ((int)t1->getf() != 0x80000000)) {
if(t1->getf() < 0.0) {
float result = jfloat_cast(0x80000000);
return TypeF::make( result );
}
else
return TypeF::ZERO;
}
// If either is a NaN, return an input NaN
if
(
g_isnan
(
f1
))
return
t1
;
if
(
g_isnan
(
f2
))
return
t2
;
// If
both numbers are not constants, we know nothing
.
if
( (t1->base() != Type::FloatCon) || (t2->base() != Type::FloatCon)
)
// If
an operand is infinity or the divisor is +/- zero, punt
.
if
(
!
g_isfinite
(
f1
)
||
!
g_isfinite
(
f2
)
||
x2
==
0
||
x2
==
min_jint
)
return
Type
::
FLOAT
;
// We must be modulo'ing 2 float constants.
// Make sure that the sign of the fmod is equal to the sign of the dividend
float result = (float)fmod( t1->getf(), t2->getf() );
float dividend = t1->getf();
if( (dividend < 0.0) || ((int)dividend == 0x80000000) ) {
if( result > 0.0 )
result = 0.0 - result;
else if( result == 0.0 ) {
result = jfloat_cast(0x80000000);
}
jint
xr
=
jint_cast
(
fmod
(
f1
,
f2
));
if
((
x1
^
xr
)
<
0
)
{
xr
^=
min_jint
;
}
return TypeF::make( result );
*/
return
TypeF
::
make
(
jfloat_cast
(
xr
));
}
...
...
@@ -940,33 +916,32 @@ const Type *ModDNode::Value( PhaseTransform *phase ) const {
(
t1
==
Type
::
BOTTOM
)
||
(
t2
==
Type
::
BOTTOM
)
)
return
bot
;
// If either is a NaN, return an input NaN
if
(
g_isnan
(
t1
->
getd
())
)
return
t1
;
if
(
g_isnan
(
t2
->
getd
())
)
return
t2
;
// X MOD infinity = X
if
(
!
g_isfinite
(
t2
->
getd
()))
return
t1
;
// 0 MOD finite = dividend (positive or negative zero)
// Not valid for: NaN MOD any; any MOD nan; 0 MOD 0; or for 0 MOD NaN
// NaNs are handled previously.
if
(
!
(
t2
->
getd
()
==
0.0
)
)
{
if
(
t1
->
getd
()
==
0.0
&&
g_isfinite
(
t2
->
getd
())
)
{
return
t1
;
}
// If either number is not a constant, we know nothing.
if
((
t1
->
base
()
!=
Type
::
DoubleCon
)
||
(
t2
->
base
()
!=
Type
::
DoubleCon
))
{
return
Type
::
DOUBLE
;
// note: x%x can be either NaN or 0
}
// X MOD X is 0
// does not work for variables because of NaN's
if
(
phase
->
eqv
(
in
(
1
),
in
(
2
)
)
&&
t1
->
base
()
==
Type
::
DoubleCon
)
if
(
!
g_isnan
(
t1
->
getd
())
&&
t1
->
getd
()
!=
0.0
)
return
TypeD
::
ZERO
;
double
f1
=
t1
->
getd
();
double
f2
=
t2
->
getd
();
jlong
x1
=
jlong_cast
(
f1
);
// note: *(long*)&f1, not just (long)f1
jlong
x2
=
jlong_cast
(
f2
);
// If either is a NaN, return an input NaN
if
(
g_isnan
(
f1
))
return
t1
;
if
(
g_isnan
(
f2
))
return
t2
;
// If
both numbers are not constants, we know nothing
.
if
(
(
t1
->
base
()
!=
Type
::
DoubleCon
)
||
(
t2
->
base
()
!=
Type
::
DoubleCon
)
)
// If
an operand is infinity or the divisor is +/- zero, punt
.
if
(
!
g_isfinite
(
f1
)
||
!
g_isfinite
(
f2
)
||
x2
==
0
||
x2
==
min_jlong
)
return
Type
::
DOUBLE
;
// We must be modulo'ing 2 double constants.
return
TypeD
::
make
(
fmod
(
t1
->
getd
(),
t2
->
getd
()
)
);
// Make sure that the sign of the fmod is equal to the sign of the dividend
jlong
xr
=
jlong_cast
(
fmod
(
f1
,
f2
));
if
((
x1
^
xr
)
<
0
)
{
xr
^=
min_jlong
;
}
return
TypeD
::
make
(
jdouble_cast
(
xr
));
}
//=============================================================================
...
...
src/share/vm/opto/parse2.cpp
浏览文件 @
b279dac8
...
...
@@ -105,10 +105,19 @@ Node* Parse::array_addressing(BasicType type, int vals, const Type* *result2) {
if
(
GenerateRangeChecks
&&
need_range_check
)
{
// Range is constant in array-oop, so we can use the original state of mem
Node
*
len
=
load_array_length
(
ary
);
// Test length vs index (standard trick using unsigned compare)
Node
*
chk
=
_gvn
.
transform
(
new
(
C
,
3
)
CmpUNode
(
idx
,
len
)
);
BoolTest
::
mask
btest
=
BoolTest
::
lt
;
Node
*
tst
=
_gvn
.
transform
(
new
(
C
,
2
)
BoolNode
(
chk
,
btest
)
);
Node
*
tst
;
if
(
sizetype
->
_hi
<=
0
)
{
// If the greatest array bound is negative, we can conclude that we're
// compiling unreachable code, but the unsigned compare trick used below
// only works with non-negative lengths. Instead, hack "tst" to be zero so
// the uncommon_trap path will always be taken.
tst
=
_gvn
.
intcon
(
0
);
}
else
{
// Test length vs index (standard trick using unsigned compare)
Node
*
chk
=
_gvn
.
transform
(
new
(
C
,
3
)
CmpUNode
(
idx
,
len
)
);
BoolTest
::
mask
btest
=
BoolTest
::
lt
;
tst
=
_gvn
.
transform
(
new
(
C
,
2
)
BoolNode
(
chk
,
btest
)
);
}
// Branch to failure if out of bounds
{
BuildCutout
unless
(
this
,
tst
,
PROB_MAX
);
if
(
C
->
allow_range_check_smearing
())
{
...
...
src/share/vm/runtime/globals.hpp
浏览文件 @
b279dac8
...
...
@@ -779,6 +779,9 @@ class CommandLineFlags {
product(bool, ClassUnloading, true, \
"Do unloading of classes") \
\
diagnostic(bool, LinkWellKnownClasses, true, \
"Resolve a well known class as soon as its name is seen") \
\
develop(bool, DisableStartThread, false, \
"Disable starting of additional Java threads " \
"(for debugging only)") \
...
...
src/share/vm/runtime/vmStructs.cpp
浏览文件 @
b279dac8
...
...
@@ -453,40 +453,7 @@ static inline uint64_t cast_uint64_t(size_t x)
static_field(SystemDictionary, _shared_dictionary, Dictionary*) \
static_field(SystemDictionary, _system_loader_lock_obj, oop) \
static_field(SystemDictionary, _loader_constraints, LoaderConstraintTable*) \
static_field(SystemDictionary, _object_klass, klassOop) \
static_field(SystemDictionary, _string_klass, klassOop) \
static_field(SystemDictionary, _class_klass, klassOop) \
static_field(SystemDictionary, _cloneable_klass, klassOop) \
static_field(SystemDictionary, _classloader_klass, klassOop) \
static_field(SystemDictionary, _serializable_klass, klassOop) \
static_field(SystemDictionary, _system_klass, klassOop) \
static_field(SystemDictionary, _throwable_klass, klassOop) \
static_field(SystemDictionary, _threaddeath_klass, klassOop) \
static_field(SystemDictionary, _error_klass, klassOop) \
static_field(SystemDictionary, _exception_klass, klassOop) \
static_field(SystemDictionary, _runtime_exception_klass, klassOop) \
static_field(SystemDictionary, _classNotFoundException_klass, klassOop) \
static_field(SystemDictionary, _noClassDefFoundError_klass, klassOop) \
static_field(SystemDictionary, _linkageError_klass, klassOop) \
static_field(SystemDictionary, _classCastException_klass, klassOop) \
static_field(SystemDictionary, _arrayStoreException_klass, klassOop) \
static_field(SystemDictionary, _virtualMachineError_klass, klassOop) \
static_field(SystemDictionary, _outOfMemoryError_klass, klassOop) \
static_field(SystemDictionary, _StackOverflowError_klass, klassOop) \
static_field(SystemDictionary, _protectionDomain_klass, klassOop) \
static_field(SystemDictionary, _AccessControlContext_klass, klassOop) \
static_field(SystemDictionary, _reference_klass, klassOop) \
static_field(SystemDictionary, _soft_reference_klass, klassOop) \
static_field(SystemDictionary, _weak_reference_klass, klassOop) \
static_field(SystemDictionary, _final_reference_klass, klassOop) \
static_field(SystemDictionary, _phantom_reference_klass, klassOop) \
static_field(SystemDictionary, _finalizer_klass, klassOop) \
static_field(SystemDictionary, _thread_klass, klassOop) \
static_field(SystemDictionary, _threadGroup_klass, klassOop) \
static_field(SystemDictionary, _properties_klass, klassOop) \
static_field(SystemDictionary, _stringBuffer_klass, klassOop) \
static_field(SystemDictionary, _vector_klass, klassOop) \
static_field(SystemDictionary, _hashtable_klass, klassOop) \
static_field(SystemDictionary, _well_known_klasses[0], klassOop) \
static_field(SystemDictionary, _box_klasses[0], klassOop) \
static_field(SystemDictionary, _java_system_loader, oop) \
\
...
...
@@ -1400,6 +1367,13 @@ static inline uint64_t cast_uint64_t(size_t x)
\
declare_constant(SystemDictionary::_loader_constraint_size) \
declare_constant(SystemDictionary::_nof_buckets) \
/* these #foo numbers are enums used to index _well_known_klasses: */
\
declare_preprocessor_constant("SystemDictionary::#object_klass", SystemDictionary::WK_KLASS_ENUM_NAME(object_klass)) \
declare_preprocessor_constant("SystemDictionary::#classloader_klass", SystemDictionary::WK_KLASS_ENUM_NAME(classloader_klass)) \
declare_preprocessor_constant("SystemDictionary::#string_klass", SystemDictionary::WK_KLASS_ENUM_NAME(string_klass)) \
declare_preprocessor_constant("SystemDictionary::#system_klass", SystemDictionary::WK_KLASS_ENUM_NAME(system_klass)) \
declare_preprocessor_constant("SystemDictionary::#thread_klass", SystemDictionary::WK_KLASS_ENUM_NAME(thread_klass)) \
declare_preprocessor_constant("SystemDictionary::#threadGroup_klass", SystemDictionary::WK_KLASS_ENUM_NAME(threadGroup_klass)) \
\
/***********************************/
\
/* LoaderConstraintTable constants */
\
...
...
src/share/vm/services/threadService.cpp
浏览文件 @
b279dac8
...
...
@@ -541,6 +541,7 @@ bool ThreadStackTrace::is_owned_monitor_on_stack(oop object) {
Handle
ThreadStackTrace
::
allocate_fill_stack_trace_element_array
(
TRAPS
)
{
klassOop
k
=
SystemDictionary
::
stackTraceElement_klass
();
assert
(
k
!=
NULL
,
"must be loaded in 1.4+"
);
instanceKlassHandle
ik
(
THREAD
,
k
);
// Allocate an array of java/lang/StackTraceElement object
...
...
test/compiler/6646019/Test.java
0 → 100644
浏览文件 @
b279dac8
/*
* Copyright 2008 Sun Microsystems, Inc. All rights reserved.
* SUN PROPRIETARY/CONFIDENTIAL. Use is subject to license terms.
*
*
*
*
*
*
*
*
*
*
*
*
*
*
*
*
*
*
*/
/*
* @test
* @bug 6646019
* @summary array subscript expressions become top() with -d64
* @run main/othervm -Xcomp -XX:CompileOnly=Test.test Test
*/
public
class
Test
{
final
static
int
i
=
2076285318
;
long
l
=
2
;
short
s
;
public
static
void
main
(
String
[]
args
)
{
Test
t
=
new
Test
();
try
{
t
.
test
();
}
catch
(
Throwable
e
)
{
if
(
t
.
l
!=
5
)
{
System
.
out
.
println
(
"Fails: "
+
t
.
l
+
" != 5"
);
}
}
}
private
void
test
()
{
l
=
5
;
l
=
(
new
short
[(
byte
)-
2
])[(
byte
)(
l
=
i
)];
}
}
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录