Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
openanolis
dragonwell8_jdk
提交
fc23c1d8
D
dragonwell8_jdk
项目概览
openanolis
/
dragonwell8_jdk
通知
4
Star
2
Fork
0
代码
文件
提交
分支
Tags
贡献者
分支图
Diff
Issue
0
列表
看板
标记
里程碑
合并请求
0
Wiki
0
Wiki
分析
仓库
DevOps
项目成员
Pages
D
dragonwell8_jdk
项目概览
项目概览
详情
发布
仓库
仓库
文件
提交
分支
标签
贡献者
分支图
比较
Issue
0
Issue
0
列表
看板
标记
里程碑
合并请求
0
合并请求
0
Pages
分析
分析
仓库分析
DevOps
Wiki
0
Wiki
成员
成员
收起侧边栏
关闭侧边栏
动态
分支图
创建新Issue
提交
Issue看板
提交
fc23c1d8
编写于
12月 21, 2012
作者:
A
amurillo
浏览文件
操作
浏览文件
下载
差异文件
Merge
上级
ce301b78
86da8e76
变更
5
隐藏空白更改
内联
并排
Showing
5 changed file
with
144 addition
and
7 deletion
+144
-7
src/share/classes/java/lang/invoke/InvokerBytecodeGenerator.java
...re/classes/java/lang/invoke/InvokerBytecodeGenerator.java
+9
-3
src/share/classes/java/lang/invoke/LambdaForm.java
src/share/classes/java/lang/invoke/LambdaForm.java
+2
-0
src/share/classes/java/lang/invoke/MethodHandleImpl.java
src/share/classes/java/lang/invoke/MethodHandleImpl.java
+3
-3
src/share/classes/sun/invoke/util/ValueConversions.java
src/share/classes/sun/invoke/util/ValueConversions.java
+9
-1
src/share/classes/sun/misc/Unsafe.java
src/share/classes/sun/misc/Unsafe.java
+121
-0
未找到文件。
src/share/classes/java/lang/invoke/InvokerBytecodeGenerator.java
浏览文件 @
fc23c1d8
...
...
@@ -295,9 +295,6 @@ class InvokerBytecodeGenerator {
String
invokerDesc
=
invokerType
.
toMethodDescriptorString
();
mv
=
cw
.
visitMethod
(
Opcodes
.
ACC_STATIC
,
invokerName
,
invokerDesc
,
null
,
null
);
// Force inlining of this invoker method.
mv
.
visitAnnotation
(
"Ljava/lang/invoke/ForceInline;"
,
true
);
}
/**
...
...
@@ -524,6 +521,9 @@ class InvokerBytecodeGenerator {
// Mark this method as a compiled LambdaForm
mv
.
visitAnnotation
(
"Ljava/lang/invoke/LambdaForm$Compiled;"
,
true
);
// Force inlining of this invoker method.
mv
.
visitAnnotation
(
"Ljava/lang/invoke/ForceInline;"
,
true
);
// iterate over the form's names, generating bytecode instructions for each
// start iterating at the first name following the arguments
for
(
int
i
=
lambdaForm
.
arity
;
i
<
lambdaForm
.
names
.
length
;
i
++)
{
...
...
@@ -943,6 +943,9 @@ class InvokerBytecodeGenerator {
// Suppress this method in backtraces displayed to the user.
mv
.
visitAnnotation
(
"Ljava/lang/invoke/LambdaForm$Hidden;"
,
true
);
// Don't inline the interpreter entry.
mv
.
visitAnnotation
(
"Ljava/lang/invoke/DontInline;"
,
true
);
// create parameter array
emitIconstInsn
(
invokerType
.
parameterCount
());
mv
.
visitTypeInsn
(
Opcodes
.
ANEWARRAY
,
"java/lang/Object"
);
...
...
@@ -1005,6 +1008,9 @@ class InvokerBytecodeGenerator {
// Suppress this method in backtraces displayed to the user.
mv
.
visitAnnotation
(
"Ljava/lang/invoke/LambdaForm$Hidden;"
,
true
);
// Force inlining of this invoker method.
mv
.
visitAnnotation
(
"Ljava/lang/invoke/ForceInline;"
,
true
);
// Load receiver
emitAloadInsn
(
0
);
...
...
src/share/classes/java/lang/invoke/LambdaForm.java
浏览文件 @
fc23c1d8
...
...
@@ -592,6 +592,7 @@ class LambdaForm {
private
int
invocationCounter
=
0
;
@Hidden
@DontInline
/** Interpretively invoke this form on the given arguments. */
Object
interpretWithArguments
(
Object
...
argumentValues
)
throws
Throwable
{
if
(
TRACE_INTERPRETER
)
...
...
@@ -606,6 +607,7 @@ class LambdaForm {
}
@Hidden
@DontInline
/** Evaluate a single Name within this form, applying its function to its arguments. */
Object
interpretName
(
Name
name
,
Object
[]
values
)
throws
Throwable
{
if
(
TRACE_INTERPRETER
)
...
...
src/share/classes/java/lang/invoke/MethodHandleImpl.java
浏览文件 @
fc23c1d8
...
...
@@ -310,9 +310,9 @@ import static java.lang.invoke.MethodHandles.Lookup.IMPL_LOOKUP;
}
static
class
AsVarargsCollector
extends
MethodHandle
{
MethodHandle
target
;
final
Class
<?>
arrayType
;
MethodHandle
cache
;
private
final
MethodHandle
target
;
private
final
Class
<?>
arrayType
;
private
MethodHandle
cache
;
AsVarargsCollector
(
MethodHandle
target
,
MethodType
type
,
Class
<?>
arrayType
)
{
super
(
type
,
reinvokerForm
(
type
));
...
...
src/share/classes/sun/invoke/util/ValueConversions.java
浏览文件 @
fc23c1d8
...
...
@@ -449,8 +449,16 @@ public class ValueConversions {
* @param x an arbitrary reference value
* @return the same value x
*/
@SuppressWarnings
(
"unchecked"
)
static
<
T
,
U
>
T
castReference
(
Class
<?
extends
T
>
t
,
U
x
)
{
return
t
.
cast
(
x
);
// inlined Class.cast because we can't ForceInline it
if
(
x
!=
null
&&
!
t
.
isInstance
(
x
))
throw
newClassCastException
(
t
,
x
);
return
(
T
)
x
;
}
private
static
ClassCastException
newClassCastException
(
Class
<?>
t
,
Object
obj
)
{
return
new
ClassCastException
(
"Cannot cast "
+
obj
.
getClass
().
getName
()
+
" to "
+
t
.
getName
());
}
private
static
final
MethodHandle
IDENTITY
,
CAST_REFERENCE
,
ZERO_OBJECT
,
IGNORE
,
EMPTY
,
...
...
src/share/classes/sun/misc/Unsafe.java
浏览文件 @
fc23c1d8
...
...
@@ -1008,4 +1008,125 @@ public final class Unsafe {
* if the load average is unobtainable.
*/
public
native
int
getLoadAverage
(
double
[]
loadavg
,
int
nelems
);
// The following contain CAS-based Java implementations used on
// platforms not supporting native instructions
/**
* Atomically adds the given value to the current value of a field
* or array element within the given object <code>o</code>
* at the given <code>offset</code>.
*
* @param o object/array to update the field/element in
* @param offset field/element offset
* @param delta the value to add
* @return the previous value
* @since 1.8
*/
public
final
int
getAndAddInt
(
Object
o
,
long
offset
,
int
delta
)
{
int
v
;
do
{
v
=
getIntVolatile
(
o
,
offset
);
}
while
(!
compareAndSwapInt
(
o
,
offset
,
v
,
v
+
delta
));
return
v
;
}
/**
* Atomically adds the given value to the current value of a field
* or array element within the given object <code>o</code>
* at the given <code>offset</code>.
*
* @param o object/array to update the field/element in
* @param offset field/element offset
* @param delta the value to add
* @return the previous value
* @since 1.8
*/
public
final
long
getAndAddLong
(
Object
o
,
long
offset
,
long
delta
)
{
long
v
;
do
{
v
=
getLongVolatile
(
o
,
offset
);
}
while
(!
compareAndSwapLong
(
o
,
offset
,
v
,
v
+
delta
));
return
v
;
}
/**
* Atomically exchanges the given value with the current value of
* a field or array element within the given object <code>o</code>
* at the given <code>offset</code>.
*
* @param o object/array to update the field/element in
* @param offset field/element offset
* @param newValue new value
* @return the previous value
* @since 1.8
*/
public
final
int
getAndSetInt
(
Object
o
,
long
offset
,
int
newValue
)
{
int
v
;
do
{
v
=
getIntVolatile
(
o
,
offset
);
}
while
(!
compareAndSwapInt
(
o
,
offset
,
v
,
newValue
));
return
v
;
}
/**
* Atomically exchanges the given value with the current value of
* a field or array element within the given object <code>o</code>
* at the given <code>offset</code>.
*
* @param o object/array to update the field/element in
* @param offset field/element offset
* @param newValue new value
* @return the previous value
* @since 1.8
*/
public
final
long
getAndSetLong
(
Object
o
,
long
offset
,
long
newValue
)
{
long
v
;
do
{
v
=
getLongVolatile
(
o
,
offset
);
}
while
(!
compareAndSwapLong
(
o
,
offset
,
v
,
newValue
));
return
v
;
}
/**
* Atomically exchanges the given reference value with the current
* reference value of a field or array element within the given
* object <code>o</code> at the given <code>offset</code>.
*
* @param o object/array to update the field/element in
* @param offset field/element offset
* @param newValue new value
* @return the previous value
* @since 1.8
*/
public
final
Object
getAndSetObject
(
Object
o
,
long
offset
,
Object
newValue
)
{
Object
v
;
do
{
v
=
getObjectVolatile
(
o
,
offset
);
}
while
(!
compareAndSwapObject
(
o
,
offset
,
v
,
newValue
));
return
v
;
}
/**
* Ensures lack of reordering of loads before the fence
* with loads or stores after the fence.
* @since 1.8
*/
public
native
void
loadFence
();
/**
* Ensures lack of reordering of stores before the fence
* with loads or stores after the fence.
* @since 1.8
*/
public
native
void
storeFence
();
/**
* Ensures lack of reordering of loads or stores before the fence
* with loads or stores after the fence.
* @since 1.8
*/
public
native
void
fullFence
();
}
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录