提交 796a8c91 编写于 作者: J jjg

6918127: improve handling of TypeAnnotationPosition fields

Reviewed-by: jjg, darcy
Contributed-by: mali@csail.mit.edu, mernst@cs.washington.edu
上级 500927f8
......@@ -264,18 +264,18 @@ public class ExtendedAnnotation {
public int offset = -1;
// For locals.
public int[] lvarOffset = new int[] { -1 };
public int[] lvarLength = new int[] { -1 };
public int[] lvarIndex = new int[] { -1 };
public int[] lvarOffset = null;
public int[] lvarLength = null;
public int[] lvarIndex = null;
// For type parameter bound
public int bound_index = -1;
public int bound_index = Integer.MIN_VALUE;
// For type parameter and method parameter
public int parameter_index = -1;
public int parameter_index = Integer.MIN_VALUE;
// For class extends, implements, and throws classes
public int type_index = -2;
public int type_index = Integer.MIN_VALUE;
// For wildcards
public Position wildcard_position = null;
......
......@@ -49,18 +49,18 @@ public class TypeAnnotationPosition {
public int offset = -1;
// For locals. arrays same length
public int[] lvarOffset = new int[] { -1 };
public int[] lvarLength = new int[] { -1 };
public int[] lvarIndex = new int[] { -1 };
public int[] lvarOffset = null;
public int[] lvarLength = null;
public int[] lvarIndex = null;
// For type parameter bound
public int bound_index = -1;
public int bound_index = Integer.MIN_VALUE;
// For type parameter and method parameter
public int parameter_index = -1;
public int parameter_index = Integer.MIN_VALUE;
// For class extends, implements, and throws classes
public int type_index = -2;
public int type_index = Integer.MIN_VALUE;
// For wildcards
public TypeAnnotationPosition wildcard_position = null;
......
......@@ -1926,9 +1926,9 @@ public class Code {
for (Attribute.TypeCompound ta : lv.sym.typeAnnotations) {
TypeAnnotationPosition p = ta.position;
while (p != null) {
p.lvarOffset[0] = (int)lv.start_pc;
p.lvarLength[0] = (int)lv.length;
p.lvarIndex[0] = (int)lv.reg;
p.lvarOffset = new int[] { (int)lv.start_pc };
p.lvarLength = new int[] { (int)lv.length };
p.lvarIndex = new int[] { (int)lv.reg };
p.isValidOffset = true;
p = p.wildcard_position;
}
......
......@@ -1714,7 +1714,7 @@ public class Gen extends JCTree.Visitor {
for (Attribute.TypeCompound ta : meth.typeAnnotations) {
if (ta.position.pos == treePos) {
ta.position.offset = code.cp;
ta.position.lvarOffset[0] = code.cp;
ta.position.lvarOffset = new int[] { code.cp };
ta.position.isValidOffset = true;
}
}
......@@ -1726,7 +1726,7 @@ public class Gen extends JCTree.Visitor {
for (Attribute.TypeCompound ta : meth.owner.typeAnnotations) {
if (ta.position.pos == treePos) {
ta.position.offset = code.cp;
ta.position.lvarOffset[0] = code.cp;
ta.position.lvarOffset = new int[] { code.cp };
ta.position.isValidOffset = true;
}
}
......@@ -1738,7 +1738,7 @@ public class Gen extends JCTree.Visitor {
for (Attribute.TypeCompound ta : s.typeAnnotations) {
if (ta.position.pos == treePos) {
ta.position.offset = code.cp;
ta.position.lvarOffset[0] = code.cp;
ta.position.lvarOffset = new int[] { code.cp };
ta.position.isValidOffset = true;
}
}
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册