Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
openanolis
dragonwell8_jdk
提交
cd9527eb
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看板
提交
cd9527eb
编写于
11月 24, 2014
作者:
V
vlivanov
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
8063135: Enable full LF sharing by default
Reviewed-by: psandoz, shade
上级
5526a0ac
变更
7
显示空白变更内容
内联
并排
Showing
7 changed file
with
115 addition
and
204 deletion
+115
-204
src/share/classes/java/lang/invoke/MethodHandle.java
src/share/classes/java/lang/invoke/MethodHandle.java
+13
-25
src/share/classes/java/lang/invoke/MethodHandleImpl.java
src/share/classes/java/lang/invoke/MethodHandleImpl.java
+1
-5
src/share/classes/java/lang/invoke/MethodHandleStatics.java
src/share/classes/java/lang/invoke/MethodHandleStatics.java
+7
-10
src/share/classes/java/lang/invoke/MethodHandles.java
src/share/classes/java/lang/invoke/MethodHandles.java
+91
-161
test/java/lang/invoke/LFCaching/LFGarbageCollectedTest.java
test/java/lang/invoke/LFCaching/LFGarbageCollectedTest.java
+1
-1
test/java/lang/invoke/LFCaching/LFMultiThreadCachingTest.java
.../java/lang/invoke/LFCaching/LFMultiThreadCachingTest.java
+1
-1
test/java/lang/invoke/LFCaching/LFSingleThreadCachingTest.java
...java/lang/invoke/LFCaching/LFSingleThreadCachingTest.java
+1
-1
未找到文件。
src/share/classes/java/lang/invoke/MethodHandle.java
浏览文件 @
cd9527eb
...
@@ -867,15 +867,11 @@ assertEquals("[A, B, C]", (String) caToString2.invokeExact('A', "BC".toCharArray
...
@@ -867,15 +867,11 @@ assertEquals("[A, B, C]", (String) caToString2.invokeExact('A', "BC".toCharArray
MethodType
postSpreadType
=
asSpreaderChecks
(
arrayType
,
arrayLength
);
MethodType
postSpreadType
=
asSpreaderChecks
(
arrayType
,
arrayLength
);
int
arity
=
type
().
parameterCount
();
int
arity
=
type
().
parameterCount
();
int
spreadArgPos
=
arity
-
arrayLength
;
int
spreadArgPos
=
arity
-
arrayLength
;
if
(
USE_LAMBDA_FORM_EDITOR
)
{
MethodHandle
afterSpread
=
this
.
asType
(
postSpreadType
);
MethodHandle
afterSpread
=
this
.
asType
(
postSpreadType
);
BoundMethodHandle
mh
=
afterSpread
.
rebind
();
BoundMethodHandle
mh
=
afterSpread
.
rebind
();
LambdaForm
lform
=
mh
.
editor
().
spreadArgumentsForm
(
1
+
spreadArgPos
,
arrayType
,
arrayLength
);
LambdaForm
lform
=
mh
.
editor
().
spreadArgumentsForm
(
1
+
spreadArgPos
,
arrayType
,
arrayLength
);
MethodType
preSpreadType
=
postSpreadType
.
replaceParameterTypes
(
spreadArgPos
,
arity
,
arrayType
);
MethodType
preSpreadType
=
postSpreadType
.
replaceParameterTypes
(
spreadArgPos
,
arity
,
arrayType
);
return
mh
.
copyWith
(
preSpreadType
,
lform
);
return
mh
.
copyWith
(
preSpreadType
,
lform
);
}
else
{
return
MethodHandleImpl
.
makeSpreadArguments
(
this
,
arrayType
,
spreadArgPos
,
arrayLength
);
}
}
}
/**
/**
...
@@ -996,7 +992,6 @@ assertEquals("[123]", (String) longsToString.invokeExact((long)123));
...
@@ -996,7 +992,6 @@ assertEquals("[123]", (String) longsToString.invokeExact((long)123));
public
MethodHandle
asCollector
(
Class
<?>
arrayType
,
int
arrayLength
)
{
public
MethodHandle
asCollector
(
Class
<?>
arrayType
,
int
arrayLength
)
{
asCollectorChecks
(
arrayType
,
arrayLength
);
asCollectorChecks
(
arrayType
,
arrayLength
);
int
collectArgPos
=
type
().
parameterCount
()
-
1
;
int
collectArgPos
=
type
().
parameterCount
()
-
1
;
if
(
USE_LAMBDA_FORM_EDITOR
)
{
BoundMethodHandle
mh
=
rebind
();
BoundMethodHandle
mh
=
rebind
();
MethodType
resultType
=
type
().
asCollectorType
(
arrayType
,
arrayLength
);
MethodType
resultType
=
type
().
asCollectorType
(
arrayType
,
arrayLength
);
MethodHandle
newArray
=
MethodHandleImpl
.
varargsArray
(
arrayType
,
arrayLength
);
MethodHandle
newArray
=
MethodHandleImpl
.
varargsArray
(
arrayType
,
arrayLength
);
...
@@ -1006,13 +1001,6 @@ assertEquals("[123]", (String) longsToString.invokeExact((long)123));
...
@@ -1006,13 +1001,6 @@ assertEquals("[123]", (String) longsToString.invokeExact((long)123));
}
}
lform
=
mh
.
editor
().
collectArgumentsForm
(
1
+
collectArgPos
,
newArray
.
type
().
basicType
());
lform
=
mh
.
editor
().
collectArgumentsForm
(
1
+
collectArgPos
,
newArray
.
type
().
basicType
());
return
mh
.
copyWithExtendL
(
resultType
,
lform
,
newArray
);
return
mh
.
copyWithExtendL
(
resultType
,
lform
,
newArray
);
}
else
{
MethodHandle
target
=
this
;
if
(
arrayType
!=
type
().
parameterType
(
collectArgPos
))
target
=
MethodHandleImpl
.
makePairwiseConvert
(
this
,
type
().
changeParameterType
(
collectArgPos
,
arrayType
),
true
);
MethodHandle
collector
=
MethodHandleImpl
.
varargsArray
(
arrayType
,
arrayLength
);
return
MethodHandles
.
collectArguments
(
target
,
collectArgPos
,
collector
);
}
}
}
/**
/**
...
...
src/share/classes/java/lang/invoke/MethodHandleImpl.java
浏览文件 @
cd9527eb
...
@@ -191,11 +191,7 @@ import static java.lang.invoke.MethodHandles.Lookup.IMPL_LOOKUP;
...
@@ -191,11 +191,7 @@ import static java.lang.invoke.MethodHandles.Lookup.IMPL_LOOKUP;
MethodType
dstType
=
target
.
type
();
MethodType
dstType
=
target
.
type
();
if
(
srcType
==
dstType
)
if
(
srcType
==
dstType
)
return
target
;
return
target
;
if
(
USE_LAMBDA_FORM_EDITOR
)
{
return
makePairwiseConvertByEditor
(
target
,
srcType
,
strict
,
monobox
);
return
makePairwiseConvertByEditor
(
target
,
srcType
,
strict
,
monobox
);
}
else
{
return
makePairwiseConvertIndirect
(
target
,
srcType
,
strict
,
monobox
);
}
}
}
private
static
int
countNonNull
(
Object
[]
array
)
{
private
static
int
countNonNull
(
Object
[]
array
)
{
...
...
src/share/classes/java/lang/invoke/MethodHandleStatics.java
浏览文件 @
cd9527eb
...
@@ -45,23 +45,21 @@ import sun.misc.Unsafe;
...
@@ -45,23 +45,21 @@ import sun.misc.Unsafe;
static
final
boolean
DUMP_CLASS_FILES
;
static
final
boolean
DUMP_CLASS_FILES
;
static
final
boolean
TRACE_INTERPRETER
;
static
final
boolean
TRACE_INTERPRETER
;
static
final
boolean
TRACE_METHOD_LINKAGE
;
static
final
boolean
TRACE_METHOD_LINKAGE
;
static
final
boolean
USE_LAMBDA_FORM_EDITOR
;
static
final
int
COMPILE_THRESHOLD
;
static
final
int
COMPILE_THRESHOLD
;
static
final
int
DONT_INLINE_THRESHOLD
;
static
final
int
DONT_INLINE_THRESHOLD
;
static
final
int
PROFILE_LEVEL
;
static
final
int
PROFILE_LEVEL
;
static
{
static
{
final
Object
[]
values
=
new
Object
[
8
];
final
Object
[]
values
=
new
Object
[
7
];
AccessController
.
doPrivileged
(
new
PrivilegedAction
<
Void
>()
{
AccessController
.
doPrivileged
(
new
PrivilegedAction
<
Void
>()
{
public
Void
run
()
{
public
Void
run
()
{
values
[
0
]
=
Boolean
.
getBoolean
(
"java.lang.invoke.MethodHandle.DEBUG_NAMES"
);
values
[
0
]
=
Boolean
.
getBoolean
(
"java.lang.invoke.MethodHandle.DEBUG_NAMES"
);
values
[
1
]
=
Boolean
.
getBoolean
(
"java.lang.invoke.MethodHandle.DUMP_CLASS_FILES"
);
values
[
1
]
=
Boolean
.
getBoolean
(
"java.lang.invoke.MethodHandle.DUMP_CLASS_FILES"
);
values
[
2
]
=
Boolean
.
getBoolean
(
"java.lang.invoke.MethodHandle.TRACE_INTERPRETER"
);
values
[
2
]
=
Boolean
.
getBoolean
(
"java.lang.invoke.MethodHandle.TRACE_INTERPRETER"
);
values
[
3
]
=
Boolean
.
getBoolean
(
"java.lang.invoke.MethodHandle.TRACE_METHOD_LINKAGE"
);
values
[
3
]
=
Boolean
.
getBoolean
(
"java.lang.invoke.MethodHandle.TRACE_METHOD_LINKAGE"
);
values
[
4
]
=
Boolean
.
getBoolean
(
"java.lang.invoke.MethodHandle.USE_LF_EDITOR"
);
values
[
4
]
=
Integer
.
getInteger
(
"java.lang.invoke.MethodHandle.COMPILE_THRESHOLD"
,
30
);
values
[
5
]
=
Integer
.
getInteger
(
"java.lang.invoke.MethodHandle.COMPILE_THRESHOLD"
,
30
);
values
[
5
]
=
Integer
.
getInteger
(
"java.lang.invoke.MethodHandle.DONT_INLINE_THRESHOLD"
,
30
);
values
[
6
]
=
Integer
.
getInteger
(
"java.lang.invoke.MethodHandle.DONT_INLINE_THRESHOLD"
,
30
);
values
[
6
]
=
Integer
.
getInteger
(
"java.lang.invoke.MethodHandle.PROFILE_LEVEL"
,
0
);
values
[
7
]
=
Integer
.
getInteger
(
"java.lang.invoke.MethodHandle.PROFILE_LEVEL"
,
0
);
return
null
;
return
null
;
}
}
});
});
...
@@ -69,10 +67,9 @@ import sun.misc.Unsafe;
...
@@ -69,10 +67,9 @@ import sun.misc.Unsafe;
DUMP_CLASS_FILES
=
(
Boolean
)
values
[
1
];
DUMP_CLASS_FILES
=
(
Boolean
)
values
[
1
];
TRACE_INTERPRETER
=
(
Boolean
)
values
[
2
];
TRACE_INTERPRETER
=
(
Boolean
)
values
[
2
];
TRACE_METHOD_LINKAGE
=
(
Boolean
)
values
[
3
];
TRACE_METHOD_LINKAGE
=
(
Boolean
)
values
[
3
];
USE_LAMBDA_FORM_EDITOR
=
(
Boolean
)
values
[
4
];
COMPILE_THRESHOLD
=
(
Integer
)
values
[
4
];
COMPILE_THRESHOLD
=
(
Integer
)
values
[
5
];
DONT_INLINE_THRESHOLD
=
(
Integer
)
values
[
5
];
DONT_INLINE_THRESHOLD
=
(
Integer
)
values
[
6
];
PROFILE_LEVEL
=
(
Integer
)
values
[
6
];
PROFILE_LEVEL
=
(
Integer
)
values
[
7
];
}
}
/** Tell if any of the debugging switches are turned on.
/** Tell if any of the debugging switches are turned on.
...
...
src/share/classes/java/lang/invoke/MethodHandles.java
浏览文件 @
cd9527eb
...
@@ -2104,7 +2104,6 @@ assert((int)twice.invokeExact(21) == 42);
...
@@ -2104,7 +2104,6 @@ assert((int)twice.invokeExact(21) == 42);
reorder
=
reorder
.
clone
();
// get a private copy
reorder
=
reorder
.
clone
();
// get a private copy
MethodType
oldType
=
target
.
type
();
MethodType
oldType
=
target
.
type
();
permuteArgumentChecks
(
reorder
,
newType
,
oldType
);
permuteArgumentChecks
(
reorder
,
newType
,
oldType
);
if
(
USE_LAMBDA_FORM_EDITOR
)
{
// first detect dropped arguments and handle them separately
// first detect dropped arguments and handle them separately
int
[]
originalReorder
=
reorder
;
int
[]
originalReorder
=
reorder
;
BoundMethodHandle
result
=
target
.
rebind
();
BoundMethodHandle
result
=
target
.
rebind
();
...
@@ -2164,55 +2163,6 @@ assert((int)twice.invokeExact(21) == 42);
...
@@ -2164,55 +2163,6 @@ assert((int)twice.invokeExact(21) == 42);
if
(
newType
==
result
.
type
()
&&
form
==
result
.
internalForm
())
if
(
newType
==
result
.
type
()
&&
form
==
result
.
internalForm
())
return
result
;
return
result
;
return
result
.
copyWith
(
newType
,
form
);
return
result
.
copyWith
(
newType
,
form
);
}
else
{
// first detect dropped arguments and handle them separately
MethodHandle
originalTarget
=
target
;
int
newArity
=
newType
.
parameterCount
();
for
(
int
dropIdx
;
(
dropIdx
=
findFirstDrop
(
reorder
,
newArity
))
>=
0
;
)
{
// dropIdx is missing from reorder; add it in at the end
int
oldArity
=
reorder
.
length
;
target
=
dropArguments
(
target
,
oldArity
,
newType
.
parameterType
(
dropIdx
));
reorder
=
Arrays
.
copyOf
(
reorder
,
oldArity
+
1
);
reorder
[
oldArity
]
=
dropIdx
;
}
assert
(
target
==
originalTarget
||
permuteArgumentChecks
(
reorder
,
newType
,
target
.
type
()));
// Note: This may cache too many distinct LFs. Consider backing off to varargs code.
BoundMethodHandle
result
=
target
.
rebind
();
LambdaForm
form
=
result
.
form
.
permuteArguments
(
1
,
reorder
,
basicTypes
(
newType
.
parameterList
()));
return
result
.
copyWith
(
newType
,
form
);
}
}
/** Return the first value in [0..newArity-1] that is not present in reorder. */
private
static
int
findFirstDrop
(
int
[]
reorder
,
int
newArity
)
{
final
int
BIT_LIMIT
=
63
;
// max number of bits in bit mask
if
(
newArity
<
BIT_LIMIT
)
{
long
mask
=
0
;
for
(
int
arg
:
reorder
)
{
assert
(
arg
<
newArity
);
mask
|=
(
1L
<<
arg
);
}
if
(
mask
==
(
1L
<<
newArity
)
-
1
)
{
assert
(
Long
.
numberOfTrailingZeros
(
Long
.
lowestOneBit
(~
mask
))
==
newArity
);
return
-
1
;
}
// find first zero
long
zeroBit
=
Long
.
lowestOneBit
(~
mask
);
int
zeroPos
=
Long
.
numberOfTrailingZeros
(
zeroBit
);
assert
(
zeroPos
<
newArity
);
return
zeroPos
;
}
else
{
BitSet
mask
=
new
BitSet
(
newArity
);
for
(
int
arg
:
reorder
)
{
assert
(
arg
<
newArity
);
mask
.
set
(
arg
);
}
int
zeroPos
=
mask
.
nextClearBit
(
0
);
assert
(
zeroPos
<=
newArity
);
if
(
zeroPos
==
newArity
)
return
-
1
;
return
zeroPos
;
}
}
}
/**
/**
...
@@ -2503,14 +2453,10 @@ assertEquals("yz", (String) d0.invokeExact(123, "x", "y", "z"));
...
@@ -2503,14 +2453,10 @@ assertEquals("yz", (String) d0.invokeExact(123, "x", "y", "z"));
if
(
dropped
==
0
)
return
target
;
if
(
dropped
==
0
)
return
target
;
BoundMethodHandle
result
=
target
.
rebind
();
BoundMethodHandle
result
=
target
.
rebind
();
LambdaForm
lform
=
result
.
form
;
LambdaForm
lform
=
result
.
form
;
if
(
USE_LAMBDA_FORM_EDITOR
)
{
int
insertFormArg
=
1
+
pos
;
int
insertFormArg
=
1
+
pos
;
for
(
Class
<?>
ptype
:
valueTypes
)
{
for
(
Class
<?>
ptype
:
valueTypes
)
{
lform
=
lform
.
editor
().
addArgumentForm
(
insertFormArg
++,
BasicType
.
basicType
(
ptype
));
lform
=
lform
.
editor
().
addArgumentForm
(
insertFormArg
++,
BasicType
.
basicType
(
ptype
));
}
}
}
else
{
lform
=
lform
.
addArguments
(
pos
,
valueTypes
);
}
result
=
result
.
copyWith
(
newType
,
lform
);
result
=
result
.
copyWith
(
newType
,
lform
);
return
result
;
return
result
;
}
}
...
@@ -2660,7 +2606,6 @@ assertEquals("XY", (String) f2.invokeExact("x", "y")); // XY
...
@@ -2660,7 +2606,6 @@ assertEquals("XY", (String) f2.invokeExact("x", "y")); // XY
/*non-public*/
static
/*non-public*/
static
MethodHandle
filterArgument
(
MethodHandle
target
,
int
pos
,
MethodHandle
filter
)
{
MethodHandle
filterArgument
(
MethodHandle
target
,
int
pos
,
MethodHandle
filter
)
{
filterArgumentChecks
(
target
,
pos
,
filter
);
filterArgumentChecks
(
target
,
pos
,
filter
);
if
(
USE_LAMBDA_FORM_EDITOR
)
{
MethodType
targetType
=
target
.
type
();
MethodType
targetType
=
target
.
type
();
MethodType
filterType
=
filter
.
type
();
MethodType
filterType
=
filter
.
type
();
BoundMethodHandle
result
=
target
.
rebind
();
BoundMethodHandle
result
=
target
.
rebind
();
...
@@ -2669,9 +2614,6 @@ assertEquals("XY", (String) f2.invokeExact("x", "y")); // XY
...
@@ -2669,9 +2614,6 @@ assertEquals("XY", (String) f2.invokeExact("x", "y")); // XY
MethodType
newType
=
targetType
.
changeParameterType
(
pos
,
newParamType
);
MethodType
newType
=
targetType
.
changeParameterType
(
pos
,
newParamType
);
result
=
result
.
copyWithExtendL
(
newType
,
lform
,
filter
);
result
=
result
.
copyWithExtendL
(
newType
,
lform
,
filter
);
return
result
;
return
result
;
}
else
{
return
MethodHandleImpl
.
makeCollectArguments
(
target
,
filter
,
pos
,
false
);
}
}
}
private
static
void
filterArgumentsCheckArity
(
MethodHandle
target
,
int
pos
,
MethodHandle
[]
filters
)
{
private
static
void
filterArgumentsCheckArity
(
MethodHandle
target
,
int
pos
,
MethodHandle
[]
filters
)
{
...
@@ -2798,7 +2740,6 @@ assertEquals("[top, [[up, down, strange], charm], bottom]",
...
@@ -2798,7 +2740,6 @@ assertEquals("[top, [[up, down, strange], charm], bottom]",
public
static
public
static
MethodHandle
collectArguments
(
MethodHandle
target
,
int
pos
,
MethodHandle
filter
)
{
MethodHandle
collectArguments
(
MethodHandle
target
,
int
pos
,
MethodHandle
filter
)
{
MethodType
newType
=
collectArgumentsChecks
(
target
,
pos
,
filter
);
MethodType
newType
=
collectArgumentsChecks
(
target
,
pos
,
filter
);
if
(
USE_LAMBDA_FORM_EDITOR
)
{
MethodType
collectorType
=
filter
.
type
();
MethodType
collectorType
=
filter
.
type
();
BoundMethodHandle
result
=
target
.
rebind
();
BoundMethodHandle
result
=
target
.
rebind
();
LambdaForm
lform
;
LambdaForm
lform
;
...
@@ -2810,9 +2751,6 @@ assertEquals("[top, [[up, down, strange], charm], bottom]",
...
@@ -2810,9 +2751,6 @@ assertEquals("[top, [[up, down, strange], charm], bottom]",
}
}
lform
=
result
.
editor
().
collectArgumentsForm
(
1
+
pos
,
collectorType
.
basicType
());
lform
=
result
.
editor
().
collectArgumentsForm
(
1
+
pos
,
collectorType
.
basicType
());
return
result
.
copyWithExtendL
(
newType
,
lform
,
filter
);
return
result
.
copyWithExtendL
(
newType
,
lform
,
filter
);
}
else
{
return
MethodHandleImpl
.
makeCollectArguments
(
target
,
filter
,
pos
,
false
);
}
}
}
private
static
MethodType
collectArgumentsChecks
(
MethodHandle
target
,
int
pos
,
MethodHandle
filter
)
throws
RuntimeException
{
private
static
MethodType
collectArgumentsChecks
(
MethodHandle
target
,
int
pos
,
MethodHandle
filter
)
throws
RuntimeException
{
...
@@ -2891,16 +2829,12 @@ System.out.println((int) f0.invokeExact("x", "y")); // 2
...
@@ -2891,16 +2829,12 @@ System.out.println((int) f0.invokeExact("x", "y")); // 2
MethodType
targetType
=
target
.
type
();
MethodType
targetType
=
target
.
type
();
MethodType
filterType
=
filter
.
type
();
MethodType
filterType
=
filter
.
type
();
filterReturnValueChecks
(
targetType
,
filterType
);
filterReturnValueChecks
(
targetType
,
filterType
);
if
(
USE_LAMBDA_FORM_EDITOR
)
{
BoundMethodHandle
result
=
target
.
rebind
();
BoundMethodHandle
result
=
target
.
rebind
();
BasicType
rtype
=
BasicType
.
basicType
(
filterType
.
returnType
());
BasicType
rtype
=
BasicType
.
basicType
(
filterType
.
returnType
());
LambdaForm
lform
=
result
.
editor
().
filterReturnForm
(
rtype
,
false
);
LambdaForm
lform
=
result
.
editor
().
filterReturnForm
(
rtype
,
false
);
MethodType
newType
=
targetType
.
changeReturnType
(
filterType
.
returnType
());
MethodType
newType
=
targetType
.
changeReturnType
(
filterType
.
returnType
());
result
=
result
.
copyWithExtendL
(
newType
,
lform
,
filter
);
result
=
result
.
copyWithExtendL
(
newType
,
lform
,
filter
);
return
result
;
return
result
;
}
else
{
return
MethodHandleImpl
.
makeCollectArguments
(
filter
,
target
,
0
,
false
);
}
}
}
private
static
void
filterReturnValueChecks
(
MethodType
targetType
,
MethodType
filterType
)
throws
RuntimeException
{
private
static
void
filterReturnValueChecks
(
MethodType
targetType
,
MethodType
filterType
)
throws
RuntimeException
{
...
@@ -2994,7 +2928,6 @@ assertEquals("boojum", (String) catTrace.invokeExact("boo", "jum"));
...
@@ -2994,7 +2928,6 @@ assertEquals("boojum", (String) catTrace.invokeExact("boo", "jum"));
MethodType
targetType
=
target
.
type
();
MethodType
targetType
=
target
.
type
();
MethodType
combinerType
=
combiner
.
type
();
MethodType
combinerType
=
combiner
.
type
();
Class
<?>
rtype
=
foldArgumentChecks
(
foldPos
,
targetType
,
combinerType
);
Class
<?>
rtype
=
foldArgumentChecks
(
foldPos
,
targetType
,
combinerType
);
if
(
USE_LAMBDA_FORM_EDITOR
)
{
BoundMethodHandle
result
=
target
.
rebind
();
BoundMethodHandle
result
=
target
.
rebind
();
boolean
dropResult
=
(
rtype
==
void
.
class
);
boolean
dropResult
=
(
rtype
==
void
.
class
);
// Note: This may cache too many distinct LFs. Consider backing off to varargs code.
// Note: This may cache too many distinct LFs. Consider backing off to varargs code.
...
@@ -3004,9 +2937,6 @@ assertEquals("boojum", (String) catTrace.invokeExact("boo", "jum"));
...
@@ -3004,9 +2937,6 @@ assertEquals("boojum", (String) catTrace.invokeExact("boo", "jum"));
newType
=
newType
.
dropParameterTypes
(
foldPos
,
foldPos
+
1
);
newType
=
newType
.
dropParameterTypes
(
foldPos
,
foldPos
+
1
);
result
=
result
.
copyWithExtendL
(
newType
,
lform
,
combiner
);
result
=
result
.
copyWithExtendL
(
newType
,
lform
,
combiner
);
return
result
;
return
result
;
}
else
{
return
MethodHandleImpl
.
makeCollectArguments
(
target
,
combiner
,
foldPos
,
true
);
}
}
}
private
static
Class
<?>
foldArgumentChecks
(
int
foldPos
,
MethodType
targetType
,
MethodType
combinerType
)
{
private
static
Class
<?>
foldArgumentChecks
(
int
foldPos
,
MethodType
targetType
,
MethodType
combinerType
)
{
...
...
test/java/lang/invoke/LFCaching/LFGarbageCollectedTest.java
浏览文件 @
cd9527eb
...
@@ -31,7 +31,7 @@
...
@@ -31,7 +31,7 @@
* @build TestMethods
* @build TestMethods
* @build LambdaFormTestCase
* @build LambdaFormTestCase
* @build LFGarbageCollectedTest
* @build LFGarbageCollectedTest
* @run main/othervm/timeout=600 -D
java.lang.invoke.MethodHandle.USE_LF_EDITOR=true -D
testLimit=150 LFGarbageCollectedTest
* @run main/othervm/timeout=600 -DtestLimit=150 LFGarbageCollectedTest
*/
*/
import
java.lang.invoke.MethodHandle
;
import
java.lang.invoke.MethodHandle
;
...
...
test/java/lang/invoke/LFCaching/LFMultiThreadCachingTest.java
浏览文件 @
cd9527eb
...
@@ -31,7 +31,7 @@
...
@@ -31,7 +31,7 @@
* @build LambdaFormTestCase
* @build LambdaFormTestCase
* @build LFCachingTestCase
* @build LFCachingTestCase
* @build LFMultiThreadCachingTest
* @build LFMultiThreadCachingTest
* @run main/othervm/timeout=300
-Djava.lang.invoke.MethodHandle.USE_LF_EDITOR=true
LFMultiThreadCachingTest
* @run main/othervm/timeout=300 LFMultiThreadCachingTest
*/
*/
import
java.lang.invoke.MethodHandle
;
import
java.lang.invoke.MethodHandle
;
...
...
test/java/lang/invoke/LFCaching/LFSingleThreadCachingTest.java
浏览文件 @
cd9527eb
...
@@ -31,7 +31,7 @@
...
@@ -31,7 +31,7 @@
* @build LambdaFormTestCase
* @build LambdaFormTestCase
* @build LFCachingTestCase
* @build LFCachingTestCase
* @build LFSingleThreadCachingTest
* @build LFSingleThreadCachingTest
* @run main/othervm/timeout=300
-Djava.lang.invoke.MethodHandle.USE_LF_EDITOR=true
LFSingleThreadCachingTest
* @run main/othervm/timeout=300 LFSingleThreadCachingTest
*/
*/
import
java.lang.invoke.MethodHandle
;
import
java.lang.invoke.MethodHandle
;
...
...
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录