Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
openanolis
dragonwell8_jdk
提交
b8a229a5
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看板
提交
b8a229a5
编写于
10月 19, 2012
作者:
T
twisti
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
8000989: smaller code changes to make future JSR 292 backports easier
Reviewed-by: jrose
上级
e8344529
变更
13
隐藏空白更改
内联
并排
Showing
13 changed file
with
52 addition
and
39 deletion
+52
-39
src/share/classes/java/lang/invoke/BoundMethodHandle.java
src/share/classes/java/lang/invoke/BoundMethodHandle.java
+11
-11
src/share/classes/java/lang/invoke/CallSite.java
src/share/classes/java/lang/invoke/CallSite.java
+1
-1
src/share/classes/java/lang/invoke/DirectMethodHandle.java
src/share/classes/java/lang/invoke/DirectMethodHandle.java
+3
-3
src/share/classes/java/lang/invoke/InvokerBytecodeGenerator.java
...re/classes/java/lang/invoke/InvokerBytecodeGenerator.java
+3
-3
src/share/classes/java/lang/invoke/Invokers.java
src/share/classes/java/lang/invoke/Invokers.java
+6
-6
src/share/classes/java/lang/invoke/LambdaForm.java
src/share/classes/java/lang/invoke/LambdaForm.java
+2
-2
src/share/classes/java/lang/invoke/MemberName.java
src/share/classes/java/lang/invoke/MemberName.java
+1
-1
src/share/classes/java/lang/invoke/MethodHandle.java
src/share/classes/java/lang/invoke/MethodHandle.java
+2
-2
src/share/classes/java/lang/invoke/MethodHandleImpl.java
src/share/classes/java/lang/invoke/MethodHandleImpl.java
+1
-1
src/share/classes/java/lang/invoke/MethodHandleStatics.java
src/share/classes/java/lang/invoke/MethodHandleStatics.java
+7
-1
src/share/classes/sun/invoke/util/ValueConversions.java
src/share/classes/sun/invoke/util/ValueConversions.java
+11
-4
test/java/lang/invoke/BigArityTest.java
test/java/lang/invoke/BigArityTest.java
+1
-1
test/java/lang/invoke/PrivateInvokeTest.java
test/java/lang/invoke/PrivateInvokeTest.java
+3
-3
未找到文件。
src/share/classes/java/lang/invoke/BoundMethodHandle.java
浏览文件 @
b8a229a5
...
...
@@ -79,7 +79,7 @@ import com.sun.xml.internal.ws.org.objectweb.asm.Type;
default
:
throw
new
InternalError
(
"unexpected xtype: "
+
xtype
);
}
}
catch
(
Throwable
t
)
{
throw
new
InternalError
(
t
);
throw
newInternalError
(
t
);
}
}
...
...
@@ -97,7 +97,7 @@ import com.sun.xml.internal.ws.org.objectweb.asm.Type;
case
'D'
:
return
cloneExtendD
(
type
,
form
,
(
double
)
x
);
}
}
catch
(
Throwable
t
)
{
throw
new
InternalError
(
t
);
throw
newInternalError
(
t
);
}
throw
new
InternalError
(
"unexpected type: "
+
xtype
);
}
...
...
@@ -115,7 +115,7 @@ import com.sun.xml.internal.ws.org.objectweb.asm.Type;
try
{
return
clone
(
srcType
,
form
);
}
catch
(
Throwable
t
)
{
throw
new
InternalError
(
t
);
throw
newInternalError
(
t
);
}
}
...
...
@@ -124,7 +124,7 @@ import com.sun.xml.internal.ws.org.objectweb.asm.Type;
try
{
return
clone
(
newType
,
form
.
permuteArguments
(
1
,
reorder
,
basicTypes
(
newType
.
parameterList
())));
}
catch
(
Throwable
t
)
{
throw
new
InternalError
(
t
);
throw
newInternalError
(
t
);
}
}
...
...
@@ -166,7 +166,7 @@ import com.sun.xml.internal.ws.org.objectweb.asm.Type;
case
'J'
:
return
argJ
(
i
);
}
}
catch
(
Throwable
ex
)
{
throw
new
InternalError
(
ex
);
throw
newInternalError
(
ex
);
}
throw
new
InternalError
(
"unexpected type: "
+
speciesData
().
types
+
"."
+
i
);
}
...
...
@@ -192,7 +192,7 @@ import com.sun.xml.internal.ws.org.objectweb.asm.Type;
try
{
return
(
MethodHandle
)
argL
(
0
);
}
catch
(
Throwable
ex
)
{
throw
new
InternalError
(
ex
);
throw
newInternalError
(
ex
);
}
}
...
...
@@ -464,7 +464,7 @@ import com.sun.xml.internal.ws.org.objectweb.asm.Type;
}
}
}
catch
(
Throwable
e
)
{
throw
new
InternalError
(
e
);
throw
newInternalError
(
e
);
}
for
(
SpeciesData
d
:
CACHE
.
values
())
{
...
...
@@ -748,7 +748,7 @@ import com.sun.xml.internal.ws.org.objectweb.asm.Type;
try
{
return
LOOKUP
.
findGetter
(
cbmhClass
,
fieldName
,
fieldType
);
}
catch
(
NoSuchFieldException
|
IllegalAccessException
e
)
{
throw
new
InternalError
(
e
);
throw
newInternalError
(
e
);
}
}
...
...
@@ -776,7 +776,7 @@ import com.sun.xml.internal.ws.org.objectweb.asm.Type;
Field
F_SPECIES_DATA
=
cbmh
.
getDeclaredField
(
"SPECIES_DATA"
);
return
(
SpeciesData
)
F_SPECIES_DATA
.
get
(
null
);
}
catch
(
ReflectiveOperationException
ex
)
{
throw
new
InternalError
(
ex
);
throw
newInternalError
(
ex
);
}
}
...
...
@@ -802,7 +802,7 @@ import com.sun.xml.internal.ws.org.objectweb.asm.Type;
try
{
return
linkConstructor
(
LOOKUP
.
findConstructor
(
cbmh
,
MethodType
.
fromMethodDescriptorString
(
makeSignature
(
types
,
true
),
null
)));
}
catch
(
NoSuchMethodException
|
IllegalAccessException
|
IllegalArgumentException
|
TypeNotPresentException
e
)
{
throw
new
InternalError
(
e
);
throw
newInternalError
(
e
);
}
}
...
...
@@ -833,7 +833,7 @@ import com.sun.xml.internal.ws.org.objectweb.asm.Type;
linkerMN
=
MemberName
.
getFactory
().
resolveOrFail
(
REF_invokeStatic
,
linkerMN
,
null
,
NoSuchMethodException
.
class
);
assert
(
linkerMN
.
isStatic
());
}
catch
(
ReflectiveOperationException
ex
)
{
throw
new
InternalError
(
ex
);
throw
newInternalError
(
ex
);
}
// extend arguments array
Object
[]
newArgs
=
Arrays
.
copyOf
(
initName
.
arguments
,
initName
.
arguments
.
length
+
1
);
...
...
src/share/classes/java/lang/invoke/CallSite.java
浏览文件 @
b8a229a5
...
...
@@ -222,7 +222,7 @@ public class CallSite {
GET_TARGET
=
IMPL_LOOKUP
.
findVirtual
(
CallSite
.
class
,
"getTarget"
,
MethodType
.
methodType
(
MethodHandle
.
class
));
}
catch
(
ReflectiveOperationException
e
)
{
throw
new
InternalError
(
e
);
throw
newInternalError
(
e
);
}
}
...
...
src/share/classes/java/lang/invoke/DirectMethodHandle.java
浏览文件 @
b8a229a5
...
...
@@ -218,7 +218,7 @@ class DirectMethodHandle extends MethodHandle {
try
{
linker
=
IMPL_NAMES
.
resolveOrFail
(
REF_invokeStatic
,
linker
,
null
,
NoSuchMethodException
.
class
);
}
catch
(
ReflectiveOperationException
ex
)
{
throw
new
InternalError
(
ex
);
throw
newInternalError
(
ex
);
}
final
int
DMH_THIS
=
0
;
final
int
ARG_BASE
=
1
;
...
...
@@ -554,7 +554,7 @@ class DirectMethodHandle extends MethodHandle {
try
{
linker
=
IMPL_NAMES
.
resolveOrFail
(
REF_invokeVirtual
,
linker
,
null
,
NoSuchMethodException
.
class
);
}
catch
(
ReflectiveOperationException
ex
)
{
throw
new
InternalError
(
ex
);
throw
newInternalError
(
ex
);
}
// What is the external type of the lambda form?
...
...
@@ -653,7 +653,7 @@ class DirectMethodHandle extends MethodHandle {
nf
.
resolve
();
}
}
catch
(
ReflectiveOperationException
ex
)
{
throw
new
InternalError
(
ex
);
throw
newInternalError
(
ex
);
}
}
}
src/share/classes/java/lang/invoke/InvokerBytecodeGenerator.java
浏览文件 @
b8a229a5
...
...
@@ -138,7 +138,7 @@ class InvokerBytecodeGenerator {
DUMP_CLASS_FILES_DIR
=
dumpDir
;
System
.
out
.
println
(
"Dumping class files to "
+
DUMP_CLASS_FILES_DIR
+
"/..."
);
}
catch
(
Exception
e
)
{
throw
new
InternalError
(
e
);
throw
newInternalError
(
e
);
}
}
else
{
DUMP_CLASS_FILES_COUNTERS
=
null
;
...
...
@@ -162,7 +162,7 @@ class InvokerBytecodeGenerator {
file
.
close
();
return
null
;
}
catch
(
IOException
ex
)
{
throw
new
InternalError
(
ex
);
throw
newInternalError
(
ex
);
}
}
});
...
...
@@ -279,7 +279,7 @@ class InvokerBytecodeGenerator {
try
{
member
=
MEMBERNAME_FACTORY
.
resolveOrFail
(
REF_invokeStatic
,
member
,
HOST_CLASS
,
ReflectiveOperationException
.
class
);
}
catch
(
ReflectiveOperationException
e
)
{
throw
new
InternalError
(
e
);
throw
newInternalError
(
e
);
}
//System.out.println("resolveInvokerMember => "+member);
return
member
;
...
...
src/share/classes/java/lang/invoke/Invokers.java
浏览文件 @
b8a229a5
...
...
@@ -27,6 +27,7 @@ package java.lang.invoke;
import
java.util.Arrays
;
import
sun.invoke.empty.Empty
;
import
static
java
.
lang
.
invoke
.
MethodHandleStatics
.*;
import
static
java
.
lang
.
invoke
.
MethodHandleNatives
.
Constants
.*;
import
static
java
.
lang
.
invoke
.
MethodHandles
.
Lookup
.
IMPL_LOOKUP
;
import
static
java
.
lang
.
invoke
.
LambdaForm
.*;
...
...
@@ -128,9 +129,8 @@ class Invokers {
try
{
//Lookup.findVirtual(MethodHandle.class, name, type);
return
IMPL_LOOKUP
.
resolveOrFail
(
REF_invokeVirtual
,
MethodHandle
.
class
,
name
,
type
);
}
catch
(
ReflectiveOperationException
ex
)
{
throw
new
InternalError
(
"JVM cannot find invoker for "
+
type
,
ex
);
throw
newInternalError
(
"JVM cannot find invoker for "
+
type
,
ex
);
}
}
...
...
@@ -176,7 +176,7 @@ class Invokers {
.
findVirtual
(
MethodHandle
.
class
,
"asSpreader"
,
MethodType
.
methodType
(
MethodHandle
.
class
,
Class
.
class
,
int
.
class
));
}
catch
(
ReflectiveOperationException
ex
)
{
throw
new
InternalError
(
ex
);
throw
newInternalError
(
ex
);
}
makeSpreader
=
MethodHandles
.
insertArguments
(
makeSpreader
,
1
,
Object
[].
class
,
spreadArgCount
);
vaInvoker
=
MethodHandles
.
filterArgument
(
arrayInvoker
,
0
,
makeSpreader
);
...
...
@@ -215,7 +215,7 @@ class Invokers {
.
findStatic
(
CallSite
.
class
,
"uninitializedCallSite"
,
MethodType
.
methodType
(
Empty
.
class
));
}
catch
(
ReflectiveOperationException
ex
)
{
throw
new
InternalError
(
ex
);
throw
newInternalError
(
ex
);
}
}
invoker
=
MethodHandles
.
explicitCastArguments
(
invoker
,
MethodType
.
methodType
(
targetType
.
returnType
()));
...
...
@@ -389,7 +389,7 @@ class Invokers {
form
.
genericInvoker
=
gamh
;
return
gamh
;
}
catch
(
Exception
ex
)
{
throw
new
InternalError
(
"Exception while resolving inexact invoke"
,
ex
);
throw
newInternalError
(
"Exception while resolving inexact invoke"
,
ex
);
}
}
...
...
@@ -456,7 +456,7 @@ class Invokers {
NF_getCallSiteTarget
.
resolve
();
// bound
}
catch
(
ReflectiveOperationException
ex
)
{
throw
new
InternalError
(
ex
);
throw
newInternalError
(
ex
);
}
}
...
...
src/share/classes/java/lang/invoke/LambdaForm.java
浏览文件 @
b8a229a5
...
...
@@ -457,7 +457,7 @@ class LambdaForm {
isCompiled
=
true
;
return
vmentry
;
}
catch
(
Error
|
Exception
ex
)
{
throw
new
InternalError
(
this
.
toString
(),
ex
);
throw
newInternalError
(
this
.
toString
(),
ex
);
}
}
...
...
@@ -1547,7 +1547,7 @@ class LambdaForm {
try
{
zmem
=
IMPL_NAMES
.
resolveOrFail
(
REF_invokeStatic
,
zmem
,
null
,
NoSuchMethodException
.
class
);
}
catch
(
IllegalAccessException
|
NoSuchMethodException
ex
)
{
throw
new
InternalError
(
ex
);
throw
newInternalError
(
ex
);
}
NamedFunction
zcon
=
new
NamedFunction
(
zmem
);
Name
n
=
new
Name
(
zcon
).
newIndex
(
0
);
...
...
src/share/classes/java/lang/invoke/MemberName.java
浏览文件 @
b8a229a5
...
...
@@ -558,7 +558,7 @@ import java.util.Objects;
try
{
return
(
MemberName
)
super
.
clone
();
}
catch
(
CloneNotSupportedException
ex
)
{
throw
new
InternalError
(
ex
);
throw
newInternalError
(
ex
);
}
}
...
...
src/share/classes/java/lang/invoke/MethodHandle.java
浏览文件 @
b8a229a5
...
...
@@ -1372,7 +1372,7 @@ assertEquals("[three, thee, tee]", asListFix.invoke((Object)argv).toString());
NF_reinvokerTarget
=
new
LambdaForm
.
NamedFunction
(
MethodHandle
.
class
.
getDeclaredMethod
(
"reinvokerTarget"
));
}
catch
(
ReflectiveOperationException
ex
)
{
throw
new
InternalError
(
ex
);
throw
newInternalError
(
ex
);
}
}
...
...
@@ -1397,7 +1397,7 @@ assertEquals("[three, thee, tee]", asListFix.invoke((Object)argv).toString());
try
{
FORM_OFFSET
=
UNSAFE
.
objectFieldOffset
(
MethodHandle
.
class
.
getDeclaredField
(
"form"
));
}
catch
(
ReflectiveOperationException
ex
)
{
throw
new
InternalError
(
ex
);
throw
newInternalError
(
ex
);
}
}
}
src/share/classes/java/lang/invoke/MethodHandleImpl.java
浏览文件 @
b8a229a5
...
...
@@ -478,7 +478,7 @@ import static java.lang.invoke.MethodHandles.Lookup.IMPL_LOOKUP;
.
getDeclaredMethod
(
"checkSpreadArgument"
,
Object
.
class
,
int
.
class
));
NF_checkSpreadArgument
.
resolve
();
}
catch
(
ReflectiveOperationException
ex
)
{
throw
new
InternalError
(
ex
);
throw
newInternalError
(
ex
);
}
}
...
...
src/share/classes/java/lang/invoke/MethodHandleStatics.java
浏览文件 @
b8a229a5
...
...
@@ -93,6 +93,12 @@ import sun.misc.Unsafe;
}
// handy shared exception makers (they simplify the common case code)
/*non-public*/
static
InternalError
newInternalError
(
String
message
,
Throwable
cause
)
{
return
new
InternalError
(
message
,
cause
);
}
/*non-public*/
static
InternalError
newInternalError
(
Throwable
cause
)
{
return
new
InternalError
(
cause
);
}
/*non-public*/
static
RuntimeException
newIllegalStateException
(
String
message
)
{
return
new
IllegalStateException
(
message
);
}
...
...
@@ -109,7 +115,7 @@ import sun.misc.Unsafe;
return
new
IllegalArgumentException
(
message
(
message
,
obj
,
obj2
));
}
/*non-public*/
static
Error
uncaughtException
(
Exception
ex
)
{
throw
new
InternalError
(
"uncaught exception"
,
ex
);
throw
newInternalError
(
"uncaught exception"
,
ex
);
}
static
Error
NYI
()
{
throw
new
AssertionError
(
"NYI"
);
...
...
src/share/classes/sun/invoke/util/ValueConversions.java
浏览文件 @
b8a229a5
...
...
@@ -475,7 +475,7 @@ public class ValueConversions {
.
findStatic
(
THIS_CLASS
,
"fillNewTypedArray"
,
MethodType
.
methodType
(
Object
[].
class
,
Object
[].
class
,
Integer
.
class
,
Object
[].
class
));
}
catch
(
NoSuchMethodException
|
IllegalAccessException
ex
)
{
throw
new
InternalError
(
"uncaught exception"
,
ex
);
throw
newInternalError
(
"uncaught exception"
,
ex
);
}
}
...
...
@@ -489,7 +489,7 @@ public class ValueConversions {
COPY_AS_PRIMITIVE_ARRAY
=
IMPL_LOOKUP
.
findStatic
(
THIS_CLASS
,
"copyAsPrimitiveArray"
,
MethodType
.
methodType
(
Object
.
class
,
Wrapper
.
class
,
Object
[].
class
));
MAKE_LIST
=
IMPL_LOOKUP
.
findStatic
(
THIS_CLASS
,
"makeList"
,
MethodType
.
methodType
(
List
.
class
,
Object
[].
class
));
}
catch
(
ReflectiveOperationException
ex
)
{
throw
new
InternalError
(
"uncaught exception"
,
ex
);
throw
newInternalError
(
"uncaught exception"
,
ex
);
}
}
}
...
...
@@ -527,9 +527,8 @@ public class ValueConversions {
MethodHandle
.
class
,
int
.
class
,
MethodHandle
.
class
);
m
.
setAccessible
(
true
);
mh
=
IMPL_LOOKUP
.
unreflect
(
m
);
}
catch
(
ReflectiveOperationException
|
SecurityException
ex
)
{
throw
new
InternalError
(
ex
);
throw
newInternalError
(
ex
);
}
COLLECT_ARGUMENTS
=
mh
;
}
...
...
@@ -1209,4 +1208,12 @@ public class ValueConversions {
private
static
MethodHandle
buildVarargsList
(
int
nargs
)
{
return
MethodHandles
.
filterReturnValue
(
varargsArray
(
nargs
),
LazyStatics
.
MAKE_LIST
);
}
// handy shared exception makers (they simplify the common case code)
private
static
InternalError
newInternalError
(
String
message
,
Throwable
cause
)
{
return
new
InternalError
(
message
,
cause
);
}
private
static
InternalError
newInternalError
(
Throwable
cause
)
{
return
new
InternalError
(
cause
);
}
}
test/java/lang/invoke/BigArityTest.java
浏览文件 @
b8a229a5
...
...
@@ -70,7 +70,7 @@ public class BigArityTest {
MethodHandles
.
lookup
().
unreflect
(
BigArityTest
.
class
.
getDeclaredMethod
(
"hashArguments"
,
Object
[].
class
));
}
catch
(
ReflectiveOperationException
ex
)
{
throw
new
Internal
Error
(
ex
);
throw
new
Error
(
ex
);
}
}
static
MethodHandle
MH_hashArguments
(
int
arity
)
{
...
...
test/java/lang/invoke/PrivateInvokeTest.java
浏览文件 @
b8a229a5
...
...
@@ -145,21 +145,21 @@ public class PrivateInvokeTest {
MH_DEBUG_STRING
=
DIRECT_INVOKER_LOOKUP
.
findVirtual
(
MethodHandle
.
class
,
"debugString"
,
methodType
(
String
.
class
));
}
catch
(
ReflectiveOperationException
ex
)
{
throw
new
Internal
Error
(
ex
);
throw
new
Error
(
ex
);
}
}
private
Object
internalMemberName
(
MethodHandle
mh
)
{
try
{
return
MH_INTERNAL_MEMBER_NAME
.
invokeExact
(
mh
);
}
catch
(
Throwable
ex
)
{
throw
new
Internal
Error
(
ex
);
throw
new
Error
(
ex
);
}
}
private
String
debugString
(
MethodHandle
mh
)
{
try
{
return
(
String
)
MH_DEBUG_STRING
.
invokeExact
(
mh
);
}
catch
(
Throwable
ex
)
{
throw
new
Internal
Error
(
ex
);
throw
new
Error
(
ex
);
}
}
private
static
MethodHandle
directInvoker
(
int
refKind
,
MethodType
mtype
)
{
...
...
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录