Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
openanolis
dragonwell8_hotspot
提交
8280c960
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看板
提交
8280c960
编写于
10月 30, 2010
作者:
J
jrose
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
6994093: MethodHandle.invokeGeneric needs porting to SPARC
Summary: SPARC code missing from fix to 6939224 Reviewed-by: twisti
上级
534df5e0
变更
3
隐藏空白更改
内联
并排
Showing
3 changed file
with
78 addition
and
9 deletion
+78
-9
src/cpu/sparc/vm/assembler_sparc.hpp
src/cpu/sparc/vm/assembler_sparc.hpp
+1
-1
src/cpu/sparc/vm/assembler_sparc.inline.hpp
src/cpu/sparc/vm/assembler_sparc.inline.hpp
+6
-1
src/cpu/sparc/vm/methodHandles_sparc.cpp
src/cpu/sparc/vm/methodHandles_sparc.cpp
+71
-7
未找到文件。
src/cpu/sparc/vm/assembler_sparc.hpp
浏览文件 @
8280c960
...
...
@@ -1126,7 +1126,7 @@ public:
inline
void
add
(
Register
s1
,
int
simm13a
,
Register
d
,
relocInfo
::
relocType
rtype
=
relocInfo
::
none
);
inline
void
add
(
Register
s1
,
int
simm13a
,
Register
d
,
RelocationHolder
const
&
rspec
);
inline
void
add
(
Register
s1
,
RegisterOrConstant
s2
,
Register
d
,
int
offset
=
0
);
inline
void
add
(
const
Address
&
a
,
Register
d
,
int
offset
=
0
)
{
add
(
a
.
base
(),
a
.
disp
()
+
offset
,
d
,
a
.
rspec
(
offset
));
}
inline
void
add
(
const
Address
&
a
,
Register
d
,
int
offset
=
0
)
;
void
addcc
(
Register
s1
,
Register
s2
,
Register
d
)
{
emit_long
(
op
(
arith_op
)
|
rd
(
d
)
|
op3
(
add_op3
|
cc_bit_op3
)
|
rs1
(
s1
)
|
rs2
(
s2
)
);
}
void
addcc
(
Register
s1
,
int
simm13a
,
Register
d
)
{
emit_long
(
op
(
arith_op
)
|
rd
(
d
)
|
op3
(
add_op3
|
cc_bit_op3
)
|
rs1
(
s1
)
|
immed
(
true
)
|
simm
(
simm13a
,
13
)
);
}
...
...
src/cpu/sparc/vm/assembler_sparc.inline.hpp
浏览文件 @
8280c960
/*
* Copyright (c) 1997, 20
09
, Oracle and/or its affiliates. All rights reserved.
* Copyright (c) 1997, 20
10
, Oracle and/or its affiliates. All rights reserved.
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
*
* This code is free software; you can redistribute it and/or modify it
...
...
@@ -206,6 +206,11 @@ inline void Assembler::ld( Register s1, RegisterOrConstant s2, Register d) { ld
inline
void
Assembler
::
ldd
(
Register
s1
,
RegisterOrConstant
s2
,
Register
d
)
{
ldd
(
Address
(
s1
,
s2
),
d
);
}
// form effective addresses this way:
inline
void
Assembler
::
add
(
const
Address
&
a
,
Register
d
,
int
offset
)
{
if
(
a
.
has_index
())
add
(
a
.
base
(),
a
.
index
(),
d
);
else
{
add
(
a
.
base
(),
a
.
disp
()
+
offset
,
d
,
a
.
rspec
(
offset
));
offset
=
0
;
}
if
(
offset
!=
0
)
add
(
d
,
offset
,
d
);
}
inline
void
Assembler
::
add
(
Register
s1
,
RegisterOrConstant
s2
,
Register
d
,
int
offset
)
{
if
(
s2
.
is_register
())
add
(
s1
,
s2
.
as_register
(),
d
);
else
{
add
(
s1
,
s2
.
as_constant
()
+
offset
,
d
);
offset
=
0
;
}
...
...
src/cpu/sparc/vm/methodHandles_sparc.cpp
浏览文件 @
8280c960
...
...
@@ -77,10 +77,22 @@ address MethodHandles::generate_method_handle_interpreter_entry(MacroAssembler*
// O0, O1: garbage temps, blown away
Register
O0_argslot
=
O0
;
Register
O1_scratch
=
O1
;
Register
O2_scratch
=
O2
;
Register
O3_scratch
=
O3
;
Register
O4_argbase
=
O4
;
Register
O5_mtype
=
O5
;
// emit WrongMethodType path first, to enable back-branch from main path
Label
wrong_method_type
;
__
bind
(
wrong_method_type
);
Label
invoke_generic_slow_path
;
assert
(
methodOopDesc
::
intrinsic_id_size_in_bytes
()
==
sizeof
(
u1
),
""
);;
__
ldub
(
Address
(
G5_method
,
methodOopDesc
::
intrinsic_id_offset_in_bytes
()),
O1_scratch
);
__
cmp
(
O1_scratch
,
(
int
)
vmIntrinsics
::
_invokeExact
);
__
brx
(
Assembler
::
notEqual
,
false
,
Assembler
::
pt
,
invoke_generic_slow_path
);
__
delayed
()
->
nop
();
__
mov
(
O5_mtype
,
G5_method_type
);
// required by throw_WrongMethodType
// mov(G3_method_handle, G3_method_handle); // already in this register
__
jump_to
(
AddressLiteral
(
Interpreter
::
throw_WrongMethodType_entry
()),
O1_scratch
);
__
delayed
()
->
nop
();
...
...
@@ -88,23 +100,75 @@ address MethodHandles::generate_method_handle_interpreter_entry(MacroAssembler*
__
align
(
CodeEntryAlignment
);
address
entry_point
=
__
pc
();
// fetch the MethodType from the method handle
into G5_method_type
// fetch the MethodType from the method handle
{
Register
tem
=
G5_method
;
assert
(
tem
==
G5_method_type
,
"yes, it's the same register"
);
for
(
jint
*
pchase
=
methodOopDesc
::
method_type_offsets_chain
();
(
*
pchase
)
!=
-
1
;
pchase
++
)
{
__
ld_ptr
(
Address
(
tem
,
*
pchase
),
G5_method_type
);
__
ld_ptr
(
Address
(
tem
,
*
pchase
),
O5_mtype
);
tem
=
O5_mtype
;
// in case there is another indirection
}
}
// given the MethodType, find out where the MH argument is buried
__
load_heap_oop
(
Address
(
G5_method_type
,
__
delayed_value
(
java_dyn_MethodType
::
form_offset_in_bytes
,
O1_scratch
)),
O0_argslot
);
__
ldsw
(
Address
(
O0_argslot
,
__
delayed_value
(
java_dyn_MethodTypeForm
::
vmslots_offset_in_bytes
,
O1_scratch
)),
O0_argslot
);
__
ld_ptr
(
__
argument_address
(
O0_argslot
),
G3_method_handle
);
__
load_heap_oop
(
Address
(
O5_mtype
,
__
delayed_value
(
java_dyn_MethodType
::
form_offset_in_bytes
,
O1_scratch
)),
O0_argslot
);
__
ldsw
(
Address
(
O0_argslot
,
__
delayed_value
(
java_dyn_MethodTypeForm
::
vmslots_offset_in_bytes
,
O1_scratch
)),
O0_argslot
);
__
add
(
Gargs
,
__
argument_offset
(
O0_argslot
,
1
),
O4_argbase
);
// Note: argument_address uses its input as a scratch register!
__
ld_ptr
(
Address
(
O4_argbase
,
-
Interpreter
::
stackElementSize
),
G3_method_handle
);
trace_method_handle
(
_masm
,
"invokeExact"
);
__
check_method_handle_type
(
G5_method_
type
,
G3_method_handle
,
O1_scratch
,
wrong_method_type
);
__
check_method_handle_type
(
O5_m
type
,
G3_method_handle
,
O1_scratch
,
wrong_method_type
);
__
jump_to_method_handle_entry
(
G3_method_handle
,
O1_scratch
);
// for invokeGeneric (only), apply argument and result conversions on the fly
__
bind
(
invoke_generic_slow_path
);
#ifdef ASSERT
{
Label
L
;
__
ldub
(
Address
(
G5_method
,
methodOopDesc
::
intrinsic_id_offset_in_bytes
()),
O1_scratch
);
__
cmp
(
O1_scratch
,
(
int
)
vmIntrinsics
::
_invokeGeneric
);
__
brx
(
Assembler
::
equal
,
false
,
Assembler
::
pt
,
L
);
__
delayed
()
->
nop
();
__
stop
(
"bad methodOop::intrinsic_id"
);
__
bind
(
L
);
}
#endif //ASSERT
// make room on the stack for another pointer:
insert_arg_slots
(
_masm
,
2
*
stack_move_unit
(),
_INSERT_REF_MASK
,
O4_argbase
,
O1_scratch
,
O2_scratch
,
O3_scratch
);
// load up an adapter from the calling type (Java weaves this)
Register
O2_form
=
O2_scratch
;
Register
O3_adapter
=
O3_scratch
;
__
load_heap_oop
(
Address
(
O5_mtype
,
__
delayed_value
(
java_dyn_MethodType
::
form_offset_in_bytes
,
O1_scratch
)),
O2_form
);
// load_heap_oop(Address(O2_form, __ delayed_value(java_dyn_MethodTypeForm::genericInvoker_offset_in_bytes, O1_scratch)), O3_adapter);
// deal with old JDK versions:
__
add
(
Address
(
O2_form
,
__
delayed_value
(
java_dyn_MethodTypeForm
::
genericInvoker_offset_in_bytes
,
O1_scratch
)),
O3_adapter
);
__
cmp
(
O3_adapter
,
O2_form
);
Label
sorry_no_invoke_generic
;
__
brx
(
Assembler
::
lessUnsigned
,
false
,
Assembler
::
pn
,
sorry_no_invoke_generic
);
__
delayed
()
->
nop
();
__
load_heap_oop
(
Address
(
O3_adapter
,
0
),
O3_adapter
);
__
tst
(
O3_adapter
);
__
brx
(
Assembler
::
zero
,
false
,
Assembler
::
pn
,
sorry_no_invoke_generic
);
__
delayed
()
->
nop
();
__
st_ptr
(
O3_adapter
,
Address
(
O4_argbase
,
1
*
Interpreter
::
stackElementSize
));
// As a trusted first argument, pass the type being called, so the adapter knows
// the actual types of the arguments and return values.
// (Generic invokers are shared among form-families of method-type.)
__
st_ptr
(
O5_mtype
,
Address
(
O4_argbase
,
0
*
Interpreter
::
stackElementSize
));
// FIXME: assert that O3_adapter is of the right method-type.
__
mov
(
O3_adapter
,
G3_method_handle
);
trace_method_handle
(
_masm
,
"invokeGeneric"
);
__
jump_to_method_handle_entry
(
G3_method_handle
,
O1_scratch
);
__
bind
(
sorry_no_invoke_generic
);
// no invokeGeneric implementation available!
__
mov
(
O5_mtype
,
G5_method_type
);
// required by throw_WrongMethodType
// mov(G3_method_handle, G3_method_handle); // already in this register
__
jump_to
(
AddressLiteral
(
Interpreter
::
throw_WrongMethodType_entry
()),
O1_scratch
);
__
delayed
()
->
nop
();
return
entry_point
;
}
...
...
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录