I2AHH2: add 8040327-Eliminate-AnnotatedType-8040319-Clean-up-type-annotation-exception-index.patch
This commit is contained in:
parent
b6e37734dc
commit
9244b456f5
@ -0,0 +1,91 @@
|
||||
diff --git a/langtools/src/share/classes/com/sun/tools/javac/code/TypeAnnotationPosition.java b/langtools/src/share/classes/com/sun/tools/javac/code/TypeAnnotationPosition.java
|
||||
index c481ea5d..f1f92b6a 100644
|
||||
--- a/langtools/src/share/classes/com/sun/tools/javac/code/TypeAnnotationPosition.java
|
||||
+++ b/langtools/src/share/classes/com/sun/tools/javac/code/TypeAnnotationPosition.java
|
||||
@@ -297,6 +297,29 @@ public class TypeAnnotationPosition {
|
||||
isValidOffset = true;
|
||||
}
|
||||
|
||||
+ public boolean hasCatchType() {
|
||||
+ return exception_index < 0 && exception_index != Integer.MIN_VALUE;
|
||||
+ }
|
||||
+
|
||||
+ public int getCatchType() {
|
||||
+ Assert.check(hasCatchType(),
|
||||
+ "exception_index does not contain valid catch info");
|
||||
+ return ((-this.exception_index) - 1) & 0xff ;
|
||||
+ }
|
||||
+
|
||||
+ public int getStartPos() {
|
||||
+ Assert.check(hasCatchType(),
|
||||
+ "exception_index does not contain valid catch info");
|
||||
+ return ((-this.exception_index) - 1) >> 8;
|
||||
+ }
|
||||
+
|
||||
+ public void setCatchInfo(final int catchType, final int startPos) {
|
||||
+ Assert.check(this.exception_index < 0,
|
||||
+ "exception_index already contains a bytecode index");
|
||||
+ Assert.check(catchType >= 0, "Expected a valid catch type");
|
||||
+ this.exception_index = -((catchType | startPos << 8) + 1);
|
||||
+ }
|
||||
+
|
||||
/**
|
||||
* Decode the binary representation for a type path and set
|
||||
* the {@code location} field.
|
||||
diff --git a/langtools/src/share/classes/com/sun/tools/javac/jvm/Code.java b/langtools/src/share/classes/com/sun/tools/javac/jvm/Code.java
|
||||
index 738c5a1d..622a5942 100644
|
||||
--- a/langtools/src/share/classes/com/sun/tools/javac/jvm/Code.java
|
||||
+++ b/langtools/src/share/classes/com/sun/tools/javac/jvm/Code.java
|
||||
@@ -2135,14 +2135,16 @@ public class Code {
|
||||
// same location; updating one is enough.
|
||||
// Use -666 as a marker that the exception_index was already updated.
|
||||
if (p.type_index != -666) {
|
||||
- p.exception_index = findExceptionIndex(p.type_index);
|
||||
+ p.exception_index = findExceptionIndex(p);
|
||||
p.type_index = -666;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
- private int findExceptionIndex(int catchType) {
|
||||
+ private int findExceptionIndex(TypeAnnotationPosition p) {
|
||||
+ final int catchType = p.getCatchType();
|
||||
+ final int startPos = p.getStartPos();
|
||||
if (catchType == Integer.MIN_VALUE) {
|
||||
// We didn't set the catch type index correctly.
|
||||
// This shouldn't happen.
|
||||
@@ -2154,8 +2156,9 @@ public class Code {
|
||||
for (int i = 0; i < len; ++i) {
|
||||
char[] catchEntry = iter.head;
|
||||
iter = iter.tail;
|
||||
- char ct = catchEntry[3];
|
||||
- if (catchType == ct) {
|
||||
+ int ct = catchEntry[3];
|
||||
+ int sp = catchEntry[0];
|
||||
+ if (catchType == ct && sp == startPos) {
|
||||
return i;
|
||||
}
|
||||
}
|
||||
diff --git a/langtools/src/share/classes/com/sun/tools/javac/jvm/Gen.java b/langtools/src/share/classes/com/sun/tools/javac/jvm/Gen.java
|
||||
index 4cc7fb7b..f79d3eee 100644
|
||||
--- a/langtools/src/share/classes/com/sun/tools/javac/jvm/Gen.java
|
||||
+++ b/langtools/src/share/classes/com/sun/tools/javac/jvm/Gen.java
|
||||
@@ -1609,7 +1609,7 @@ public class Gen extends JCTree.Visitor {
|
||||
if (subCatch.type.isAnnotated()) {
|
||||
for (Attribute.TypeCompound tc :
|
||||
subCatch.type.getAnnotationMirrors()) {
|
||||
- tc.position.type_index = catchType;
|
||||
+ tc.position.setCatchInfo(catchType, startpc);
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -1626,7 +1626,7 @@ public class Gen extends JCTree.Visitor {
|
||||
if (subCatch.type.isAnnotated()) {
|
||||
for (Attribute.TypeCompound tc :
|
||||
subCatch.type.getAnnotationMirrors()) {
|
||||
- tc.position.type_index = catchType;
|
||||
+ tc.position.setCatchInfo(catchType, startpc);
|
||||
}
|
||||
}
|
||||
}
|
||||
@ -915,7 +915,7 @@ Provides: java-%{javaver}-%{origin}-accessibility%{?1} = %{epoch}:%{version}-%{r
|
||||
|
||||
Name: java-%{javaver}-%{origin}
|
||||
Version: %{javaver}.%{updatever}.%{buildver}
|
||||
Release: 10
|
||||
Release: 11
|
||||
# java-1.5.0-ibm from jpackage.org set Epoch to 1 for unknown reasons
|
||||
# and this change was brought into RHEL-4. java-1.5.0-ibm packages
|
||||
# also included the epoch in their virtual provides. This created a
|
||||
@ -1066,6 +1066,7 @@ Patch137: 8250861-Crash-in-MinINode-Ideal-PhaseGVN-bool.patch
|
||||
Patch138: add-appcds-file-lock.patch
|
||||
Patch139: G1-memory-uncommit.patch
|
||||
Patch140: 8015927-Class-reference-duplicates-in-constant-pool.patch
|
||||
Patch141: 8040327-Eliminate-AnnotatedType-8040319-Clean-up-type-annotation-exception-index.patch
|
||||
|
||||
#############################################
|
||||
#
|
||||
@ -1487,6 +1488,7 @@ pushd %{top_level_dir_name}
|
||||
%patch138 -p1
|
||||
%patch139 -p1
|
||||
%patch140 -p1
|
||||
%patch141 -p1
|
||||
|
||||
popd
|
||||
|
||||
@ -2103,6 +2105,9 @@ require "copy_jdk_configs.lua"
|
||||
%endif
|
||||
|
||||
%changelog
|
||||
* Wed Dec 23 2020 DataAndOperation <mashoubing1@huawei.com> - 1:1.8.0.272-b10.11
|
||||
- add 8040327-Eliminate-AnnotatedType-8040319-Clean-up-type-annotation-exception-index.patch
|
||||
|
||||
* Thu Dec 22 2020 miaozhuojun <mouzhuojun@huawei.com> - 1:1.8.0.272-b10.10
|
||||
- add 8015927-Class-reference-duplicates-in-constant-pool.patch
|
||||
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user