提交 6a89ab24 编写于 作者: J jjg

6919986: [308] change size of type_index (of CLASS_EXTENDS and THROWS) from byte to short

Reviewed-by: darcy, jjg
Contributed-by: mali@csail.mit.edu, mernst@cs.washington.edu
上级 314298b3
......@@ -123,11 +123,14 @@ public class ExtendedAnnotation {
// Class extends and implements clauses
case CLASS_EXTENDS:
case CLASS_EXTENDS_GENERIC_OR_ARRAY:
position.type_index = cr.readUnsignedByte();
int in = cr.readUnsignedShort();
if (in == 0xFFFF)
in = -1;
position.type_index = in;
break;
// throws
case THROWS:
position.type_index = cr.readUnsignedByte();
position.type_index = cr.readUnsignedShort();
break;
case CLASS_LITERAL:
case CLASS_LITERAL_GENERIC_OR_ARRAY:
......@@ -213,11 +216,11 @@ public class ExtendedAnnotation {
// Class extends and implements clauses
case CLASS_EXTENDS:
case CLASS_EXTENDS_GENERIC_OR_ARRAY:
n += 1; // type_index
n += 2; // type_index
break;
// throws
case THROWS:
n += 1; // type_index
n += 2; // type_index
break;
case CLASS_LITERAL:
case CLASS_LITERAL_GENERIC_OR_ARRAY:
......
......@@ -149,11 +149,7 @@ public class TypeAnnotations {
JCFieldAccess fieldFrame = (JCFieldAccess)frame;
if ("class".contentEquals(fieldFrame.name)) {
p.type = TargetType.CLASS_LITERAL;
if (fieldFrame.selected instanceof JCAnnotatedType) {
p.pos = TreeInfo.typeIn(fieldFrame).pos;
} else if (fieldFrame.selected instanceof JCArrayTypeTree) {
p.pos = fieldFrame.selected.pos;
}
p.pos = TreeInfo.innermostType(fieldFrame.selected).pos;
} else
throw new AssertionError();
return p;
......
......@@ -1425,11 +1425,11 @@ public class ClassReader implements Completer {
// Class extends and implements clauses
case CLASS_EXTENDS:
case CLASS_EXTENDS_GENERIC_OR_ARRAY:
position.type_index = nextByte();
position.type_index = nextChar();
break;
// throws
case THROWS:
position.type_index = nextByte();
position.type_index = nextChar();
break;
case CLASS_LITERAL:
case CLASS_LITERAL_GENERIC_OR_ARRAY:
......
......@@ -965,11 +965,11 @@ public class ClassWriter extends ClassFile {
// Class extends and implements clauses
case CLASS_EXTENDS:
case CLASS_EXTENDS_GENERIC_OR_ARRAY:
databuf.appendByte(p.type_index);
databuf.appendChar(p.type_index);
break;
// throws
case THROWS:
databuf.appendByte(p.type_index);
databuf.appendChar(p.type_index);
break;
case CLASS_LITERAL:
case CLASS_LITERAL_GENERIC_OR_ARRAY:
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册