24 */ |
24 */ |
25 |
25 |
26 package com.sun.tools.javac.jvm; |
26 package com.sun.tools.javac.jvm; |
27 |
27 |
28 import com.sun.tools.javac.code.*; |
28 import com.sun.tools.javac.code.*; |
|
29 import com.sun.tools.javac.util.List; |
29 |
30 |
30 import static com.sun.tools.javac.code.TypeTag.UNINITIALIZED_OBJECT; |
31 import static com.sun.tools.javac.code.TypeTag.UNINITIALIZED_OBJECT; |
31 import static com.sun.tools.javac.code.TypeTag.UNINITIALIZED_THIS; |
32 import static com.sun.tools.javac.code.TypeTag.UNINITIALIZED_THIS; |
32 |
33 |
33 /** These pseudo-types appear in the generated verifier tables to |
34 /** These pseudo-types appear in the generated verifier tables to |
39 * deletion without notice.</b> |
40 * deletion without notice.</b> |
40 */ |
41 */ |
41 class UninitializedType extends Type.DelegatedType { |
42 class UninitializedType extends Type.DelegatedType { |
42 |
43 |
43 public static UninitializedType uninitializedThis(Type qtype) { |
44 public static UninitializedType uninitializedThis(Type qtype) { |
44 return new UninitializedType(UNINITIALIZED_THIS, qtype, -1); |
45 return new UninitializedType(UNINITIALIZED_THIS, qtype, -1, |
|
46 qtype.getAnnotationMirrors()); |
45 } |
47 } |
46 |
48 |
47 public static UninitializedType uninitializedObject(Type qtype, int offset) { |
49 public static UninitializedType uninitializedObject(Type qtype, int offset) { |
48 return new UninitializedType(UNINITIALIZED_OBJECT, qtype, offset); |
50 return new UninitializedType(UNINITIALIZED_OBJECT, qtype, offset, |
|
51 qtype.getAnnotationMirrors()); |
49 } |
52 } |
50 |
53 |
51 public final int offset; // PC where allocation took place |
54 public final int offset; // PC where allocation took place |
52 private UninitializedType(TypeTag tag, Type qtype, int offset) { |
55 private UninitializedType(TypeTag tag, Type qtype, int offset, |
53 super(tag, qtype); |
56 List<Attribute.TypeCompound> typeAnnotations) { |
|
57 super(tag, qtype, typeAnnotations); |
54 this.offset = offset; |
58 this.offset = offset; |
|
59 } |
|
60 |
|
61 @Override |
|
62 public UninitializedType annotatedType(List<Attribute.TypeCompound> typeAnnotations) { |
|
63 return new UninitializedType(tag, qtype, offset, typeAnnotations); |
55 } |
64 } |
56 |
65 |
57 Type initializedType() { |
66 Type initializedType() { |
58 return qtype; |
67 return qtype; |
59 } |
68 } |