Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
openanolis
dragonwell8_jdk
提交
5a68336e
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看板
提交
5a68336e
编写于
5月 02, 2013
作者:
K
kizune
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
8013155: [pack200] improve performance of pack200
Reviewed-by: ksrini, jrose
上级
2e7d5571
变更
2
隐藏空白更改
内联
并排
Showing
2 changed file
with
41 addition
and
40 deletion
+41
-40
src/share/classes/com/sun/java/util/jar/pack/Code.java
src/share/classes/com/sun/java/util/jar/pack/Code.java
+0
-1
src/share/classes/com/sun/java/util/jar/pack/ConstantPool.java
...hare/classes/com/sun/java/util/jar/pack/ConstantPool.java
+41
-39
未找到文件。
src/share/classes/com/sun/java/util/jar/pack/Code.java
浏览文件 @
5a68336e
...
...
@@ -146,7 +146,6 @@ class Code extends Attribute.Holder {
int
verbose
=
getPackage
().
verbose
;
if
(
verbose
>
2
)
System
.
out
.
println
(
"Reference scan "
+
this
);
Class
cls
=
thisClass
();
refs
.
addAll
(
Arrays
.
asList
(
handler_class
));
if
(
fixups
!=
null
)
{
fixups
.
visitRefs
(
refs
);
...
...
src/share/classes/com/sun/java/util/jar/pack/ConstantPool.java
浏览文件 @
5a68336e
...
...
@@ -785,53 +785,55 @@ class ConstantPool {
return
new
String
(
sig
);
}
static
private
int
skipClassNameChars
(
String
sig
,
int
i
)
{
int
len
=
sig
.
length
();
for
(;
i
<
len
;
i
++)
{
char
ch
=
sig
.
charAt
(
i
);
if
(
ch
<=
' '
)
break
;
if
(
ch
>=
';'
&&
ch
<=
'@'
)
break
;
}
return
i
;
static
private
int
skipTo
(
char
semi
,
String
sig
,
int
i
)
{
i
=
sig
.
indexOf
(
semi
,
i
);
return
(
i
>=
0
)
?
i
:
sig
.
length
();
}
static
String
[]
structureSignature
(
String
sig
)
{
sig
=
sig
.
intern
();
int
formLen
=
0
;
int
nparts
=
1
;
for
(
int
i
=
0
;
i
<
sig
.
length
();
i
++)
{
char
ch
=
sig
.
charAt
(
i
);
formLen
++;
if
(
ch
==
'L'
)
{
nparts
++;
int
i2
=
skipClassNameChars
(
sig
,
i
+
1
);
i
=
i2
-
1
;
// keep the semicolon in the form
int
i3
=
sig
.
indexOf
(
'<'
,
i
+
1
);
if
(
i3
>
0
&&
i3
<
i2
)
i
=
i3
-
1
;
}
}
char
[]
form
=
new
char
[
formLen
];
if
(
nparts
==
1
)
{
int
firstl
=
sig
.
indexOf
(
'L'
);
if
(
firstl
<
0
)
{
String
[]
parts
=
{
sig
};
return
parts
;
}
String
[]
parts
=
new
String
[
nparts
];
int
j
=
0
;
int
k
=
1
;
for
(
int
i
=
0
;
i
<
sig
.
length
();
i
++)
{
char
ch
=
sig
.
charAt
(
i
);
form
[
j
++]
=
ch
;
if
(
ch
==
'L'
)
{
int
i2
=
skipClassNameChars
(
sig
,
i
+
1
);
parts
[
k
++]
=
sig
.
substring
(
i
+
1
,
i2
);
i
=
i2
;
--
i
;
// keep the semicolon in the form
// Segment the string like sig.split("L\\([^;<]*\\)").
// N.B.: Previous version of this code did a more complex match,
// to next ch < ' ' or ch in [';'..'@']. The only important
// characters are ';' and '<', since they are part of the
// signature syntax.
// Examples:
// "(Ljava/lang/Object;IJLLoo;)V" => {"(L;IJL;)V", "java/lang/Object", "Loo"}
// "Ljava/util/List<Ljava/lang/String;>;" => {"L<L;>;", "java/util/List", "java/lang/String"}
char
[]
form
=
null
;
String
[]
parts
=
null
;
for
(
int
pass
=
0
;
pass
<=
1
;
pass
++)
{
// pass 0 is a sizing pass, pass 1 packs the arrays
int
formPtr
=
0
;
int
partPtr
=
1
;
int
nextsemi
=
0
,
nextangl
=
0
;
// next ';' or '<', or zero, or sigLen
int
lastj
=
0
;
for
(
int
i
=
firstl
+
1
,
j
;
i
>
0
;
i
=
sig
.
indexOf
(
'L'
,
j
)
+
1
)
{
// sig[i-1] is 'L', while sig[j] will be the first ';' or '<' after it
// each part is in sig[i .. j-1]
if
(
nextsemi
<
i
)
nextsemi
=
skipTo
(
';'
,
sig
,
i
);
if
(
nextangl
<
i
)
nextangl
=
skipTo
(
'<'
,
sig
,
i
);
j
=
(
nextsemi
<
nextangl
?
nextsemi
:
nextangl
);
if
(
pass
!=
0
)
{
sig
.
getChars
(
lastj
,
i
,
form
,
formPtr
);
parts
[
partPtr
]
=
sig
.
substring
(
i
,
j
);
}
formPtr
+=
(
i
-
lastj
);
partPtr
+=
1
;
lastj
=
j
;
}
if
(
pass
!=
0
)
{
sig
.
getChars
(
lastj
,
sig
.
length
(),
form
,
formPtr
);
break
;
}
formPtr
+=
(
sig
.
length
()
-
lastj
);
form
=
new
char
[
formPtr
];
parts
=
new
String
[
partPtr
];
}
assert
(
j
==
formLen
);
assert
(
k
==
parts
.
length
);
parts
[
0
]
=
new
String
(
form
);
//assert(flattenSignature(parts).equals(sig));
return
parts
;
...
...
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录