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

Co-authored-by: Michael Ernst <mernst@cs.washington.edu>
Reviewed-by: darcy, jjg
This commit is contained in:
Mahmood Ali 2010-02-01 17:05:35 -08:00 committed by Jonathan Gibbons
parent 0b2d026575
commit 378a8861c0
4 changed files with 12 additions and 13 deletions

View File

@ -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:

View File

@ -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;

View File

@ -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:

View File

@ -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: