Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
openanolis
dragonwell8_hotspot
提交
4e725646
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看板
提交
4e725646
编写于
10月 05, 2013
作者:
C
coleenp
浏览文件
操作
浏览文件
下载
差异文件
Merge
上级
fe82854a
07739d12
变更
3
显示空白变更内容
内联
并排
Showing
3 changed file
with
1 addition
and
264 deletion
+1
-264
src/share/vm/prims/jvm.cpp
src/share/vm/prims/jvm.cpp
+0
-242
src/share/vm/prims/jvm_misc.hpp
src/share/vm/prims/jvm_misc.hpp
+0
-16
src/share/vm/prims/nativeLookup.cpp
src/share/vm/prims/nativeLookup.cpp
+1
-6
未找到文件。
src/share/vm/prims/jvm.cpp
浏览文件 @
4e725646
...
...
@@ -3954,248 +3954,6 @@ void initialize_converter_functions() {
}
// Serialization
JVM_ENTRY
(
void
,
JVM_SetPrimitiveFieldValues
(
JNIEnv
*
env
,
jclass
cb
,
jobject
obj
,
jlongArray
fieldIDs
,
jcharArray
typecodes
,
jbyteArray
data
))
assert
(
!
JDK_Version
::
is_gte_jdk14x_version
(),
"should only be used in 1.3.1 and earlier"
);
typeArrayOop
tcodes
=
typeArrayOop
(
JNIHandles
::
resolve
(
typecodes
));
typeArrayOop
dbuf
=
typeArrayOop
(
JNIHandles
::
resolve
(
data
));
typeArrayOop
fids
=
typeArrayOop
(
JNIHandles
::
resolve
(
fieldIDs
));
oop
o
=
JNIHandles
::
resolve
(
obj
);
if
(
o
==
NULL
||
fids
==
NULL
||
dbuf
==
NULL
||
tcodes
==
NULL
)
{
THROW
(
vmSymbols
::
java_lang_NullPointerException
());
}
jsize
nfids
=
fids
->
length
();
if
(
nfids
==
0
)
return
;
if
(
tcodes
->
length
()
<
nfids
)
{
THROW
(
vmSymbols
::
java_lang_ArrayIndexOutOfBoundsException
());
}
jsize
off
=
0
;
/* loop through fields, setting values */
for
(
jsize
i
=
0
;
i
<
nfids
;
i
++
)
{
jfieldID
fid
=
(
jfieldID
)(
intptr_t
)
fids
->
long_at
(
i
);
int
field_offset
;
if
(
fid
!=
NULL
)
{
// NULL is a legal value for fid, but retrieving the field offset
// trigger assertion in that case
field_offset
=
jfieldIDWorkaround
::
from_instance_jfieldID
(
o
->
klass
(),
fid
);
}
switch
(
tcodes
->
char_at
(
i
))
{
case
'Z'
:
if
(
fid
!=
NULL
)
{
jboolean
val
=
(
dbuf
->
byte_at
(
off
)
!=
0
)
?
JNI_TRUE
:
JNI_FALSE
;
o
->
bool_field_put
(
field_offset
,
val
);
}
off
++
;
break
;
case
'B'
:
if
(
fid
!=
NULL
)
{
o
->
byte_field_put
(
field_offset
,
dbuf
->
byte_at
(
off
));
}
off
++
;
break
;
case
'C'
:
if
(
fid
!=
NULL
)
{
jchar
val
=
((
dbuf
->
byte_at
(
off
+
0
)
&
0xFF
)
<<
8
)
+
((
dbuf
->
byte_at
(
off
+
1
)
&
0xFF
)
<<
0
);
o
->
char_field_put
(
field_offset
,
val
);
}
off
+=
2
;
break
;
case
'S'
:
if
(
fid
!=
NULL
)
{
jshort
val
=
((
dbuf
->
byte_at
(
off
+
0
)
&
0xFF
)
<<
8
)
+
((
dbuf
->
byte_at
(
off
+
1
)
&
0xFF
)
<<
0
);
o
->
short_field_put
(
field_offset
,
val
);
}
off
+=
2
;
break
;
case
'I'
:
if
(
fid
!=
NULL
)
{
jint
ival
=
((
dbuf
->
byte_at
(
off
+
0
)
&
0xFF
)
<<
24
)
+
((
dbuf
->
byte_at
(
off
+
1
)
&
0xFF
)
<<
16
)
+
((
dbuf
->
byte_at
(
off
+
2
)
&
0xFF
)
<<
8
)
+
((
dbuf
->
byte_at
(
off
+
3
)
&
0xFF
)
<<
0
);
o
->
int_field_put
(
field_offset
,
ival
);
}
off
+=
4
;
break
;
case
'F'
:
if
(
fid
!=
NULL
)
{
jint
ival
=
((
dbuf
->
byte_at
(
off
+
0
)
&
0xFF
)
<<
24
)
+
((
dbuf
->
byte_at
(
off
+
1
)
&
0xFF
)
<<
16
)
+
((
dbuf
->
byte_at
(
off
+
2
)
&
0xFF
)
<<
8
)
+
((
dbuf
->
byte_at
(
off
+
3
)
&
0xFF
)
<<
0
);
jfloat
fval
=
(
*
int_bits_to_float_fn
)(
env
,
NULL
,
ival
);
o
->
float_field_put
(
field_offset
,
fval
);
}
off
+=
4
;
break
;
case
'J'
:
if
(
fid
!=
NULL
)
{
jlong
lval
=
(((
jlong
)
dbuf
->
byte_at
(
off
+
0
)
&
0xFF
)
<<
56
)
+
(((
jlong
)
dbuf
->
byte_at
(
off
+
1
)
&
0xFF
)
<<
48
)
+
(((
jlong
)
dbuf
->
byte_at
(
off
+
2
)
&
0xFF
)
<<
40
)
+
(((
jlong
)
dbuf
->
byte_at
(
off
+
3
)
&
0xFF
)
<<
32
)
+
(((
jlong
)
dbuf
->
byte_at
(
off
+
4
)
&
0xFF
)
<<
24
)
+
(((
jlong
)
dbuf
->
byte_at
(
off
+
5
)
&
0xFF
)
<<
16
)
+
(((
jlong
)
dbuf
->
byte_at
(
off
+
6
)
&
0xFF
)
<<
8
)
+
(((
jlong
)
dbuf
->
byte_at
(
off
+
7
)
&
0xFF
)
<<
0
);
o
->
long_field_put
(
field_offset
,
lval
);
}
off
+=
8
;
break
;
case
'D'
:
if
(
fid
!=
NULL
)
{
jlong
lval
=
(((
jlong
)
dbuf
->
byte_at
(
off
+
0
)
&
0xFF
)
<<
56
)
+
(((
jlong
)
dbuf
->
byte_at
(
off
+
1
)
&
0xFF
)
<<
48
)
+
(((
jlong
)
dbuf
->
byte_at
(
off
+
2
)
&
0xFF
)
<<
40
)
+
(((
jlong
)
dbuf
->
byte_at
(
off
+
3
)
&
0xFF
)
<<
32
)
+
(((
jlong
)
dbuf
->
byte_at
(
off
+
4
)
&
0xFF
)
<<
24
)
+
(((
jlong
)
dbuf
->
byte_at
(
off
+
5
)
&
0xFF
)
<<
16
)
+
(((
jlong
)
dbuf
->
byte_at
(
off
+
6
)
&
0xFF
)
<<
8
)
+
(((
jlong
)
dbuf
->
byte_at
(
off
+
7
)
&
0xFF
)
<<
0
);
jdouble
dval
=
(
*
long_bits_to_double_fn
)(
env
,
NULL
,
lval
);
o
->
double_field_put
(
field_offset
,
dval
);
}
off
+=
8
;
break
;
default:
// Illegal typecode
THROW_MSG
(
vmSymbols
::
java_lang_IllegalArgumentException
(),
"illegal typecode"
);
}
}
JVM_END
JVM_ENTRY
(
void
,
JVM_GetPrimitiveFieldValues
(
JNIEnv
*
env
,
jclass
cb
,
jobject
obj
,
jlongArray
fieldIDs
,
jcharArray
typecodes
,
jbyteArray
data
))
assert
(
!
JDK_Version
::
is_gte_jdk14x_version
(),
"should only be used in 1.3.1 and earlier"
);
typeArrayOop
tcodes
=
typeArrayOop
(
JNIHandles
::
resolve
(
typecodes
));
typeArrayOop
dbuf
=
typeArrayOop
(
JNIHandles
::
resolve
(
data
));
typeArrayOop
fids
=
typeArrayOop
(
JNIHandles
::
resolve
(
fieldIDs
));
oop
o
=
JNIHandles
::
resolve
(
obj
);
if
(
o
==
NULL
||
fids
==
NULL
||
dbuf
==
NULL
||
tcodes
==
NULL
)
{
THROW
(
vmSymbols
::
java_lang_NullPointerException
());
}
jsize
nfids
=
fids
->
length
();
if
(
nfids
==
0
)
return
;
if
(
tcodes
->
length
()
<
nfids
)
{
THROW
(
vmSymbols
::
java_lang_ArrayIndexOutOfBoundsException
());
}
/* loop through fields, fetching values */
jsize
off
=
0
;
for
(
jsize
i
=
0
;
i
<
nfids
;
i
++
)
{
jfieldID
fid
=
(
jfieldID
)(
intptr_t
)
fids
->
long_at
(
i
);
if
(
fid
==
NULL
)
{
THROW
(
vmSymbols
::
java_lang_NullPointerException
());
}
int
field_offset
=
jfieldIDWorkaround
::
from_instance_jfieldID
(
o
->
klass
(),
fid
);
switch
(
tcodes
->
char_at
(
i
))
{
case
'Z'
:
{
jboolean
val
=
o
->
bool_field
(
field_offset
);
dbuf
->
byte_at_put
(
off
++
,
(
val
!=
0
)
?
1
:
0
);
}
break
;
case
'B'
:
dbuf
->
byte_at_put
(
off
++
,
o
->
byte_field
(
field_offset
));
break
;
case
'C'
:
{
jchar
val
=
o
->
char_field
(
field_offset
);
dbuf
->
byte_at_put
(
off
++
,
(
val
>>
8
)
&
0xFF
);
dbuf
->
byte_at_put
(
off
++
,
(
val
>>
0
)
&
0xFF
);
}
break
;
case
'S'
:
{
jshort
val
=
o
->
short_field
(
field_offset
);
dbuf
->
byte_at_put
(
off
++
,
(
val
>>
8
)
&
0xFF
);
dbuf
->
byte_at_put
(
off
++
,
(
val
>>
0
)
&
0xFF
);
}
break
;
case
'I'
:
{
jint
val
=
o
->
int_field
(
field_offset
);
dbuf
->
byte_at_put
(
off
++
,
(
val
>>
24
)
&
0xFF
);
dbuf
->
byte_at_put
(
off
++
,
(
val
>>
16
)
&
0xFF
);
dbuf
->
byte_at_put
(
off
++
,
(
val
>>
8
)
&
0xFF
);
dbuf
->
byte_at_put
(
off
++
,
(
val
>>
0
)
&
0xFF
);
}
break
;
case
'F'
:
{
jfloat
fval
=
o
->
float_field
(
field_offset
);
jint
ival
=
(
*
float_to_int_bits_fn
)(
env
,
NULL
,
fval
);
dbuf
->
byte_at_put
(
off
++
,
(
ival
>>
24
)
&
0xFF
);
dbuf
->
byte_at_put
(
off
++
,
(
ival
>>
16
)
&
0xFF
);
dbuf
->
byte_at_put
(
off
++
,
(
ival
>>
8
)
&
0xFF
);
dbuf
->
byte_at_put
(
off
++
,
(
ival
>>
0
)
&
0xFF
);
}
break
;
case
'J'
:
{
jlong
val
=
o
->
long_field
(
field_offset
);
dbuf
->
byte_at_put
(
off
++
,
(
val
>>
56
)
&
0xFF
);
dbuf
->
byte_at_put
(
off
++
,
(
val
>>
48
)
&
0xFF
);
dbuf
->
byte_at_put
(
off
++
,
(
val
>>
40
)
&
0xFF
);
dbuf
->
byte_at_put
(
off
++
,
(
val
>>
32
)
&
0xFF
);
dbuf
->
byte_at_put
(
off
++
,
(
val
>>
24
)
&
0xFF
);
dbuf
->
byte_at_put
(
off
++
,
(
val
>>
16
)
&
0xFF
);
dbuf
->
byte_at_put
(
off
++
,
(
val
>>
8
)
&
0xFF
);
dbuf
->
byte_at_put
(
off
++
,
(
val
>>
0
)
&
0xFF
);
}
break
;
case
'D'
:
{
jdouble
dval
=
o
->
double_field
(
field_offset
);
jlong
lval
=
(
*
double_to_long_bits_fn
)(
env
,
NULL
,
dval
);
dbuf
->
byte_at_put
(
off
++
,
(
lval
>>
56
)
&
0xFF
);
dbuf
->
byte_at_put
(
off
++
,
(
lval
>>
48
)
&
0xFF
);
dbuf
->
byte_at_put
(
off
++
,
(
lval
>>
40
)
&
0xFF
);
dbuf
->
byte_at_put
(
off
++
,
(
lval
>>
32
)
&
0xFF
);
dbuf
->
byte_at_put
(
off
++
,
(
lval
>>
24
)
&
0xFF
);
dbuf
->
byte_at_put
(
off
++
,
(
lval
>>
16
)
&
0xFF
);
dbuf
->
byte_at_put
(
off
++
,
(
lval
>>
8
)
&
0xFF
);
dbuf
->
byte_at_put
(
off
++
,
(
lval
>>
0
)
&
0xFF
);
}
break
;
default:
// Illegal typecode
THROW_MSG
(
vmSymbols
::
java_lang_IllegalArgumentException
(),
"illegal typecode"
);
}
}
JVM_END
// Shared JNI/JVM entry points //////////////////////////////////////////////////////////////
...
...
src/share/vm/prims/jvm_misc.hpp
浏览文件 @
4e725646
...
...
@@ -35,22 +35,6 @@ jclass find_class_from_class_loader(JNIEnv* env, Symbol* name, jboolean init, Ha
void
trace_class_resolution
(
Klass
*
to_class
);
/*
* Support for Serialization and RMI. Currently used by HotSpot only.
*/
extern
"C"
{
void
JNICALL
JVM_SetPrimitiveFieldValues
(
JNIEnv
*
env
,
jclass
cb
,
jobject
obj
,
jlongArray
fieldIDs
,
jcharArray
typecodes
,
jbyteArray
data
);
void
JNICALL
JVM_GetPrimitiveFieldValues
(
JNIEnv
*
env
,
jclass
cb
,
jobject
obj
,
jlongArray
fieldIDs
,
jcharArray
typecodes
,
jbyteArray
data
);
}
/*
* Support for -Xcheck:jni
*/
...
...
src/share/vm/prims/nativeLookup.cpp
浏览文件 @
4e725646
...
...
@@ -129,10 +129,6 @@ extern "C" {
#define FN_PTR(f) CAST_FROM_FN_PTR(void*, &f)
static
JNINativeMethod
lookup_special_native_methods
[]
=
{
// Next two functions only exist for compatibility with 1.3.1 and earlier.
{
CC
"Java_java_io_ObjectOutputStream_getPrimitiveFieldValues"
,
NULL
,
FN_PTR
(
JVM_GetPrimitiveFieldValues
)
},
// intercept ObjectOutputStream getPrimitiveFieldValues for faster serialization
{
CC
"Java_java_io_ObjectInputStream_setPrimitiveFieldValues"
,
NULL
,
FN_PTR
(
JVM_SetPrimitiveFieldValues
)
},
// intercept ObjectInputStream setPrimitiveFieldValues for faster serialization
{
CC
"Java_sun_misc_Unsafe_registerNatives"
,
NULL
,
FN_PTR
(
JVM_RegisterUnsafeMethods
)
},
{
CC
"Java_java_lang_invoke_MethodHandleNatives_registerNatives"
,
NULL
,
FN_PTR
(
JVM_RegisterMethodHandleMethods
)
},
{
CC
"Java_sun_misc_Perf_registerNatives"
,
NULL
,
FN_PTR
(
JVM_RegisterPerfMethods
)
},
...
...
@@ -140,9 +136,8 @@ static JNINativeMethod lookup_special_native_methods[] = {
};
static
address
lookup_special_native
(
char
*
jni_name
)
{
int
i
=
!
JDK_Version
::
is_gte_jdk14x_version
()
?
0
:
2
;
// see comment in lookup_special_native_methods
int
count
=
sizeof
(
lookup_special_native_methods
)
/
sizeof
(
JNINativeMethod
);
for
(;
i
<
count
;
i
++
)
{
for
(
int
i
=
0
;
i
<
count
;
i
++
)
{
// NB: To ignore the jni prefix and jni postfix strstr is used matching.
if
(
strstr
(
jni_name
,
lookup_special_native_methods
[
i
].
name
)
!=
NULL
)
{
return
CAST_FROM_FN_PTR
(
address
,
lookup_special_native_methods
[
i
].
fnPtr
);
...
...
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录