Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
openanolis
dragonwell8_langtools
提交
f1f305f0
D
dragonwell8_langtools
项目概览
openanolis
/
dragonwell8_langtools
通知
0
Star
2
Fork
0
代码
文件
提交
分支
Tags
贡献者
分支图
Diff
Issue
0
列表
看板
标记
里程碑
合并请求
0
Wiki
0
Wiki
分析
仓库
DevOps
项目成员
Pages
D
dragonwell8_langtools
项目概览
项目概览
详情
发布
仓库
仓库
文件
提交
分支
标签
贡献者
分支图
比较
Issue
0
Issue
0
列表
看板
标记
里程碑
合并请求
0
合并请求
0
Pages
分析
分析
仓库分析
DevOps
Wiki
0
Wiki
成员
成员
收起侧边栏
关闭侧边栏
动态
分支图
创建新Issue
提交
Issue看板
提交
f1f305f0
编写于
2月 02, 2013
作者:
V
vromero
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
8005075: Pool.Method, and Pool.Variable redundant Symbol field should be removed
Reviewed-by: jjg
上级
29e2e162
变更
3
隐藏空白更改
内联
并排
Showing
3 changed file
with
31 addition
and
29 deletion
+31
-29
src/share/classes/com/sun/tools/javac/code/Symbol.java
src/share/classes/com/sun/tools/javac/code/Symbol.java
+7
-3
src/share/classes/com/sun/tools/javac/jvm/ClassWriter.java
src/share/classes/com/sun/tools/javac/jvm/ClassWriter.java
+2
-4
src/share/classes/com/sun/tools/javac/jvm/Pool.java
src/share/classes/com/sun/tools/javac/jvm/Pool.java
+22
-22
未找到文件。
src/share/classes/com/sun/tools/javac/code/Symbol.java
浏览文件 @
f1f305f0
...
@@ -496,9 +496,9 @@ public abstract class Symbol implements Element {
...
@@ -496,9 +496,9 @@ public abstract class Symbol implements Element {
return
l
.
toList
();
return
l
.
toList
();
}
}
public
static
class
DelegatedSymbol
extends
Symbol
{
public
static
class
DelegatedSymbol
<
T
extends
Symbol
>
extends
Symbol
{
protected
Symbol
other
;
protected
T
other
;
public
DelegatedSymbol
(
Symbol
other
)
{
public
DelegatedSymbol
(
T
other
)
{
super
(
other
.
kind
,
other
.
flags_field
,
other
.
name
,
other
.
type
,
other
.
owner
);
super
(
other
.
kind
,
other
.
flags_field
,
other
.
name
,
other
.
type
,
other
.
owner
);
this
.
other
=
other
;
this
.
other
=
other
;
}
}
...
@@ -532,6 +532,10 @@ public abstract class Symbol implements Element {
...
@@ -532,6 +532,10 @@ public abstract class Symbol implements Element {
public
<
R
,
P
>
R
accept
(
Symbol
.
Visitor
<
R
,
P
>
v
,
P
p
)
{
public
<
R
,
P
>
R
accept
(
Symbol
.
Visitor
<
R
,
P
>
v
,
P
p
)
{
return
v
.
visitSymbol
(
other
,
p
);
return
v
.
visitSymbol
(
other
,
p
);
}
}
public
T
getUnderlyingSymbol
()
{
return
other
;
}
}
}
/** A class for type symbols. Type variables are represented by instances
/** A class for type symbols. Type variables are represented by instances
...
...
src/share/classes/com/sun/tools/javac/jvm/ClassWriter.java
浏览文件 @
f1f305f0
...
@@ -482,10 +482,8 @@ public class ClassWriter extends ClassFile {
...
@@ -482,10 +482,8 @@ public class ClassWriter extends ClassFile {
while
(
i
<
pool
.
pp
)
{
while
(
i
<
pool
.
pp
)
{
Object
value
=
pool
.
pool
[
i
];
Object
value
=
pool
.
pool
[
i
];
Assert
.
checkNonNull
(
value
);
Assert
.
checkNonNull
(
value
);
if
(
value
instanceof
Method
)
if
(
value
instanceof
Method
||
value
instanceof
Variable
)
value
=
((
Method
)
value
).
m
;
value
=
((
DelegatedSymbol
)
value
).
getUnderlyingSymbol
();
else
if
(
value
instanceof
Variable
)
value
=
((
Variable
)
value
).
v
;
if
(
value
instanceof
MethodSymbol
)
{
if
(
value
instanceof
MethodSymbol
)
{
MethodSymbol
m
=
(
MethodSymbol
)
value
;
MethodSymbol
m
=
(
MethodSymbol
)
value
;
...
...
src/share/classes/com/sun/tools/javac/jvm/Pool.java
浏览文件 @
f1f305f0
/*
/*
* Copyright (c) 1999, 201
2
, Oracle and/or its affiliates. All rights reserved.
* Copyright (c) 1999, 201
3
, Oracle and/or its affiliates. All rights reserved.
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
*
*
* This code is free software; you can redistribute it and/or modify it
* This code is free software; you can redistribute it and/or modify it
...
@@ -140,23 +140,23 @@ public class Pool {
...
@@ -140,23 +140,23 @@ public class Pool {
return
n
==
null
?
-
1
:
n
.
intValue
();
return
n
==
null
?
-
1
:
n
.
intValue
();
}
}
static
class
Method
extends
DelegatedSymbol
{
static
class
Method
extends
DelegatedSymbol
<
MethodSymbol
>
{
MethodSymbol
m
;
UniqueType
uniqueType
;
UniqueType
uniqueType
;
Method
(
MethodSymbol
m
,
Types
types
)
{
Method
(
MethodSymbol
m
,
Types
types
)
{
super
(
m
);
super
(
m
);
this
.
m
=
m
;
this
.
uniqueType
=
new
UniqueType
(
m
.
type
,
types
);
this
.
uniqueType
=
new
UniqueType
(
m
.
type
,
types
);
}
}
public
boolean
equals
(
Object
other
)
{
public
boolean
equals
(
Object
any
)
{
if
(!(
other
instanceof
Method
))
return
false
;
if
(!(
any
instanceof
Method
))
return
false
;
MethodSymbol
o
=
((
Method
)
other
).
m
;
MethodSymbol
o
=
((
Method
)
any
).
other
;
MethodSymbol
m
=
this
.
other
;
return
return
o
.
name
==
m
.
name
&&
o
.
name
==
m
.
name
&&
o
.
owner
==
m
.
owner
&&
o
.
owner
==
m
.
owner
&&
((
Method
)
other
).
uniqueType
.
equals
(
uniqueType
);
((
Method
)
any
).
uniqueType
.
equals
(
uniqueType
);
}
}
public
int
hashCode
()
{
public
int
hashCode
()
{
MethodSymbol
m
=
this
.
other
;
return
return
m
.
name
.
hashCode
()
*
33
+
m
.
name
.
hashCode
()
*
33
+
m
.
owner
.
hashCode
()
*
9
+
m
.
owner
.
hashCode
()
*
9
+
...
@@ -173,21 +173,21 @@ public class Pool {
...
@@ -173,21 +173,21 @@ public class Pool {
}
}
@Override
@Override
public
boolean
equals
(
Object
other
)
{
public
boolean
equals
(
Object
any
)
{
if
(!
super
.
equals
(
other
))
return
false
;
if
(!
super
.
equals
(
any
))
return
false
;
if
(!(
other
instanceof
DynamicMethod
))
return
false
;
if
(!(
any
instanceof
DynamicMethod
))
return
false
;
DynamicMethodSymbol
dm1
=
(
DynamicMethodSymbol
)
m
;
DynamicMethodSymbol
dm1
=
(
DynamicMethodSymbol
)
other
;
DynamicMethodSymbol
dm2
=
(
DynamicMethodSymbol
)((
DynamicMethod
)
other
).
m
;
DynamicMethodSymbol
dm2
=
(
DynamicMethodSymbol
)((
DynamicMethod
)
any
).
other
;
return
dm1
.
bsm
==
dm2
.
bsm
&&
return
dm1
.
bsm
==
dm2
.
bsm
&&
dm1
.
bsmKind
==
dm2
.
bsmKind
&&
dm1
.
bsmKind
==
dm2
.
bsmKind
&&
Arrays
.
equals
(
uniqueStaticArgs
,
Arrays
.
equals
(
uniqueStaticArgs
,
((
DynamicMethod
)
other
).
uniqueStaticArgs
);
((
DynamicMethod
)
any
).
uniqueStaticArgs
);
}
}
@Override
@Override
public
int
hashCode
()
{
public
int
hashCode
()
{
int
hash
=
super
.
hashCode
();
int
hash
=
super
.
hashCode
();
DynamicMethodSymbol
dm
=
(
DynamicMethodSymbol
)
m
;
DynamicMethodSymbol
dm
=
(
DynamicMethodSymbol
)
other
;
hash
+=
dm
.
bsmKind
*
7
+
hash
+=
dm
.
bsmKind
*
7
+
dm
.
bsm
.
hashCode
()
*
11
;
dm
.
bsm
.
hashCode
()
*
11
;
for
(
int
i
=
0
;
i
<
dm
.
staticArgs
.
length
;
i
++)
{
for
(
int
i
=
0
;
i
<
dm
.
staticArgs
.
length
;
i
++)
{
...
@@ -209,23 +209,23 @@ public class Pool {
...
@@ -209,23 +209,23 @@ public class Pool {
}
}
}
}
static
class
Variable
extends
DelegatedSymbol
{
static
class
Variable
extends
DelegatedSymbol
<
VarSymbol
>
{
VarSymbol
v
;
UniqueType
uniqueType
;
UniqueType
uniqueType
;
Variable
(
VarSymbol
v
,
Types
types
)
{
Variable
(
VarSymbol
v
,
Types
types
)
{
super
(
v
);
super
(
v
);
this
.
v
=
v
;
this
.
uniqueType
=
new
UniqueType
(
v
.
type
,
types
);
this
.
uniqueType
=
new
UniqueType
(
v
.
type
,
types
);
}
}
public
boolean
equals
(
Object
other
)
{
public
boolean
equals
(
Object
any
)
{
if
(!(
other
instanceof
Variable
))
return
false
;
if
(!(
any
instanceof
Variable
))
return
false
;
VarSymbol
o
=
((
Variable
)
other
).
v
;
VarSymbol
o
=
((
Variable
)
any
).
other
;
VarSymbol
v
=
other
;
return
return
o
.
name
==
v
.
name
&&
o
.
name
==
v
.
name
&&
o
.
owner
==
v
.
owner
&&
o
.
owner
==
v
.
owner
&&
((
Variable
)
other
).
uniqueType
.
equals
(
uniqueType
);
((
Variable
)
any
).
uniqueType
.
equals
(
uniqueType
);
}
}
public
int
hashCode
()
{
public
int
hashCode
()
{
VarSymbol
v
=
other
;
return
return
v
.
name
.
hashCode
()
*
33
+
v
.
name
.
hashCode
()
*
33
+
v
.
owner
.
hashCode
()
*
9
+
v
.
owner
.
hashCode
()
*
9
+
...
...
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录