Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
openanolis
dragonwell8_jdk
提交
a9c98dbd
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看板
提交
a9c98dbd
编写于
2月 19, 2013
作者:
K
ksrini
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
8008262: pack200 should support MethodParameters - part 2
Reviewed-by: jrose
上级
a865220e
变更
8
隐藏空白更改
内联
并排
Showing
8 changed file
with
43 addition
and
22 deletion
+43
-22
src/share/classes/com/sun/java/util/jar/pack/Attribute.java
src/share/classes/com/sun/java/util/jar/pack/Attribute.java
+1
-1
src/share/classes/com/sun/java/util/jar/pack/BandStructure.java
...are/classes/com/sun/java/util/jar/pack/BandStructure.java
+3
-3
src/share/classes/com/sun/java/util/jar/pack/PackageReader.java
...are/classes/com/sun/java/util/jar/pack/PackageReader.java
+1
-1
src/share/native/com/sun/java/util/jar/pack/bands.cpp
src/share/native/com/sun/java/util/jar/pack/bands.cpp
+1
-1
src/share/native/com/sun/java/util/jar/pack/bands.h
src/share/native/com/sun/java/util/jar/pack/bands.h
+2
-2
src/share/native/com/sun/java/util/jar/pack/unpack.cpp
src/share/native/com/sun/java/util/jar/pack/unpack.cpp
+2
-2
test/tools/pack200/AttributeTests.java
test/tools/pack200/AttributeTests.java
+11
-11
test/tools/pack200/Utils.java
test/tools/pack200/Utils.java
+22
-1
未找到文件。
src/share/classes/com/sun/java/util/jar/pack/Attribute.java
浏览文件 @
a9c98dbd
...
...
@@ -177,7 +177,7 @@ class Attribute implements Comparable<Attribute> {
define
(
sd
,
ATTR_CONTEXT_METHOD
,
"Synthetic"
,
""
);
define
(
sd
,
ATTR_CONTEXT_METHOD
,
"Deprecated"
,
""
);
define
(
sd
,
ATTR_CONTEXT_METHOD
,
"Exceptions"
,
"NH[RCH]"
);
define
(
sd
,
ATTR_CONTEXT_METHOD
,
"MethodParameters"
,
"NB[RUNH
I
]"
);
define
(
sd
,
ATTR_CONTEXT_METHOD
,
"MethodParameters"
,
"NB[RUNH
FH
]"
);
//define(sd, ATTR_CONTEXT_METHOD, "Code", "HHNI[B]NH[PHPOHPOHRCNH]NH[RUHNI[B]]");
define
(
sd
,
ATTR_CONTEXT_CODE
,
"StackMapTable"
,
...
...
src/share/classes/com/sun/java/util/jar/pack/BandStructure.java
浏览文件 @
a9c98dbd
...
...
@@ -1505,7 +1505,7 @@ class BandStructure {
// band for predefine method parameters
IntBand
method_MethodParameters_NB
=
method_attr_bands
.
newIntBand
(
"method_MethodParameters_NB"
,
BYTE1
);
CPRefBand
method_MethodParameters_name_RUN
=
method_attr_bands
.
newCPRefBand
(
"method_MethodParameters_name_RUN"
,
UNSIGNED5
,
CONSTANT_Utf8
,
NULL_IS_OK
);
IntBand
method_MethodParameters_flag_
I
=
method_attr_bands
.
newIntBand
(
"method_MethodParameters_flag_I
"
);
IntBand
method_MethodParameters_flag_
FH
=
method_attr_bands
.
newIntBand
(
"method_MethodParameters_flag_FH
"
);
MultiBand
class_attr_bands
=
class_bands
.
newMultiBand
(
"(class_attr_bands)"
,
UNSIGNED5
);
IntBand
class_flags_hi
=
class_attr_bands
.
newIntBand
(
"class_flags_hi"
);
...
...
@@ -1776,9 +1776,9 @@ class BandStructure {
new
Band
[]{
method_MethodParameters_NB
,
method_MethodParameters_name_RUN
,
method_MethodParameters_flag_
I
method_MethodParameters_flag_
FH
},
"MethodParameters"
,
"NB[RUNH
I
]"
);
"MethodParameters"
,
"NB[RUNH
FH
]"
);
assert
(
attrCodeEmpty
==
Package
.
attrCodeEmpty
);
predefineAttribute
(
X_ATTR_Signature
,
ATTR_CONTEXT_METHOD
,
new
Band
[]
{
method_Signature_RS
},
...
...
src/share/classes/com/sun/java/util/jar/pack/PackageReader.java
浏览文件 @
a9c98dbd
...
...
@@ -1521,7 +1521,7 @@ class PackageReader extends BandStructure {
// *method_Exceptions_RC :UNSIGNED5 (cp_Class)
// *method_MethodParameters_NB: BYTE1
// *method_MethodParameters_RUN: UNSIGNED5 (cp_Utf8)
// *method_MethodParameters_
I
: UNSIGNED5 (flag)
// *method_MethodParameters_
FH
: UNSIGNED5 (flag)
//
// code_attr_bands:
// *code_flags :UNSIGNED5
...
...
src/share/native/com/sun/java/util/jar/pack/bands.cpp
浏览文件 @
a9c98dbd
...
...
@@ -354,7 +354,7 @@ const band_init all_band_inits[] = {
BAND_INIT
(
method_metadata_bands
,
-
1
,
-
1
),
BAND_INIT
(
method_MethodParameters_NB
,
BYTE1_spec
,
0
),
BAND_INIT
(
method_MethodParameters_name_RUN
,
UNSIGNED5_spec
,
NULL_OR_INDEX
(
CONSTANT_Utf8
)),
BAND_INIT
(
method_MethodParameters_flag_
I
,
UNSIGNED5_spec
,
0
),
BAND_INIT
(
method_MethodParameters_flag_
FH
,
UNSIGNED5_spec
,
0
),
BAND_INIT
(
method_attr_bands
,
-
1
,
-
1
),
BAND_INIT
(
class_flags_hi
,
UNSIGNED5_spec
,
0
),
BAND_INIT
(
class_flags_lo
,
UNSIGNED5_spec
,
0
),
...
...
src/share/native/com/sun/java/util/jar/pack/bands.h
浏览文件 @
a9c98dbd
...
...
@@ -214,7 +214,7 @@ enum band_number {
e_method_metadata_bands
,
e_method_MethodParameters_NB
,
e_method_MethodParameters_name_RUN
,
e_method_MethodParameters_flag_
I
,
e_method_MethodParameters_flag_
FH
,
e_method_attr_bands
,
e_class_flags_hi
,
...
...
@@ -393,7 +393,7 @@ enum band_number {
#define method_Signature_RS all_bands[e_method_Signature_RS]
#define method_MethodParameters_NB all_bands[e_method_MethodParameters_NB]
#define method_MethodParameters_name_RUN all_bands[e_method_MethodParameters_name_RUN]
#define method_MethodParameters_flag_
I all_bands[e_method_MethodParameters_flag_I
]
#define method_MethodParameters_flag_
FH all_bands[e_method_MethodParameters_flag_FH
]
#define method_attr_bands all_bands[e_method_attr_bands]
#define class_flags_hi all_bands[e_class_flags_hi]
#define class_flags_lo all_bands[e_class_flags_lo]
...
...
src/share/native/com/sun/java/util/jar/pack/unpack.cpp
浏览文件 @
a9c98dbd
...
...
@@ -2488,7 +2488,7 @@ void unpacker::read_attrs(int attrc, int obj_count) {
method_MethodParameters_NB
.
readData
(
count
);
count
=
method_MethodParameters_NB
.
getIntTotal
();
method_MethodParameters_name_RUN
.
readData
(
count
);
method_MethodParameters_flag_
I
.
readData
(
count
);
method_MethodParameters_flag_
FH
.
readData
(
count
);
CHECK
;
break
;
...
...
@@ -4431,7 +4431,7 @@ int unpacker::write_attrs(int attrc, julong indexBits) {
putu1
(
count
=
method_MethodParameters_NB
.
getByte
());
for
(
j
=
0
;
j
<
count
;
j
++
)
{
putref
(
method_MethodParameters_name_RUN
.
getRefN
());
putu
4
(
method_MethodParameters_flag_I
.
getInt
());
putu
2
(
method_MethodParameters_flag_FH
.
getInt
());
}
break
;
...
...
test/tools/pack200/AttributeTests.java
浏览文件 @
a9c98dbd
...
...
@@ -29,7 +29,7 @@ import java.util.List;
import
static
java
.
nio
.
file
.
StandardOpenOption
.*;
/*
* @test
* @bug 6746111 8005252
* @bug 6746111 8005252
8008262
* @summary tests various classfile format and attribute handling by pack200
* @compile -XDignore.symbol.file Utils.java AttributeTests.java
* @run main AttributeTests
...
...
@@ -67,17 +67,17 @@ public class AttributeTests {
File
testjarFile
=
new
File
(
cwd
,
"test"
+
Utils
.
JAR_FILE_EXT
);
Utils
.
jar
(
"cvf"
,
testjarFile
.
getName
(),
javaClassName
);
// pack using --repack
File
outjarFile
=
new
File
(
cwd
,
"out"
+
Utils
.
JAR_FILE_EXT
);
scratch
.
clear
();
scratch
.
add
(
Utils
.
getPack200Cmd
());
scratch
.
add
(
"--repack"
);
scratch
.
add
(
"--unknown-attribute=error"
);
scratch
.
add
(
outjarFile
.
getName
());
scratch
.
add
(
testjarFile
.
getName
());
Utils
.
runExec
(
scratch
);
// pack using native --repack
File
nativejarFile
=
new
File
(
cwd
,
"out-n"
+
Utils
.
JAR_FILE_EXT
);
Utils
.
repack
(
testjarFile
,
nativejarFile
,
false
,
"--unknown-attribute=error"
);
Utils
.
doCompareVerify
(
testjarFile
,
nativejarFile
);
Utils
.
doCompareVerify
(
testjarFile
,
outjarFile
);
// pack using java --repack
File
javajarFile
=
new
File
(
cwd
,
"out-j"
+
Utils
.
JAR_FILE_EXT
);
Utils
.
repack
(
testjarFile
,
javajarFile
,
true
,
"--unknown-attribute=error"
);
Utils
.
doCompareBitWise
(
nativejarFile
,
javajarFile
);
}
/*
* this test checks to see if we get the expected strings for output
...
...
test/tools/pack200/Utils.java
浏览文件 @
a9c98dbd
/*
* Copyright (c) 2007, 201
2
, Oracle and/or its affiliates. All rights reserved.
* Copyright (c) 2007, 201
3
, Oracle and/or its affiliates. All rights reserved.
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
*
* This code is free software; you can redistribute it and/or modify it
...
...
@@ -314,6 +314,27 @@ class Utils {
throw
new
RuntimeException
(
"jar command failed"
);
}
}
static
List
<
String
>
repack
(
File
inFile
,
File
outFile
,
boolean
disableNative
,
String
...
extraOpts
)
{
List
<
String
>
cmdList
=
new
ArrayList
<>();
cmdList
.
clear
();
cmdList
.
add
(
Utils
.
getJavaCmd
());
cmdList
.
add
(
"-ea"
);
cmdList
.
add
(
"-esa"
);
if
(
disableNative
)
{
cmdList
.
add
(
"-Dcom.sun.java.util.jar.pack.disable.native=true"
);
}
cmdList
.
add
(
"com.sun.java.util.jar.pack.Driver"
);
cmdList
.
add
(
"--repack"
);
if
(
extraOpts
!=
null
)
{
for
(
String
opt:
extraOpts
)
{
cmdList
.
add
(
opt
);
}
}
cmdList
.
add
(
outFile
.
getName
());
cmdList
.
add
(
inFile
.
getName
());
return
Utils
.
runExec
(
cmdList
);
}
// given a jar file foo.jar will write to foo.pack
static
void
pack
(
JarFile
jarFile
,
File
packFile
)
throws
IOException
{
...
...
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录