Age | Commit message (Collapse) | Author |
|
PiperOrigin-RevId: 425631296
|
|
PiperOrigin-RevId: 386122520
|
|
When modeling primitive widening conversions, report diagnostics for
invalid conversions instead of crashing.
This rearranges the implementation to use switches on the primitive
type kinds and casts instead of double-dispatch. The new approach makes
it easier to access the position information needed to report a
diagnostic, and also makes it more explicit which constants implement
a particular conversion.
PiperOrigin-RevId: 385854947
|
|
PiperOrigin-RevId: 352623709
|
|
-------------
Created by MOE: https://github.com/google/moe
MOE_MIGRATED_REVID=261369014
|
|
ct.sym contains a fake annotation jdk/Profile+Annotation without a
corresponding class file.
-------------
Created by MOE: https://github.com/google/moe
MOE_MIGRATED_REVID=260819989
|
|
Deficient numeric types (char, byte, short) and booleans are all encoded
as integers in the class file.
Currently the class reader saves an int for all of those types, and we
coerce to the appropriate type during binding by 'target typing'.
However this logic is unnecessary for annotations, since element values
have a local type tag in the class file.
This changes class reading of annotations to immediately convert to the
appropriate type, and saves the legacy 'target typing' to only apply
to fields. We could handle fields during class reading too, but we defer
handling descriptors/signatures to binding for performance reasons.
-------------
Created by MOE: https://github.com/google/moe
MOE_MIGRATED_REVID=254034125
|
|
MOE_MIGRATED_REVID=251930479
|
|
MOE_MIGRATED_REVID=251782540
|
|
to avoid a clash with the javax.lang.model.element class.
MOE_MIGRATED_REVID=251530996
|
|
MOE_MIGRATED_REVID=225619145
|
|
in order to get equals and hashCode implementations.
MOE_MIGRATED_REVID=218399705
|
|
The type of a class literal isn't necessarily a class, as in
`void.class`.
MOE_MIGRATED_REVID=218197987
|
|
The additional information is read in lazily, so it's inexpensive if we
don't end up needing it.
MOE_MIGRATED_REVID=217633111
|
|
MOE_MIGRATED_REVID=217165296
|
|
MOE_MIGRATED_REVID=182836497
|
|
Given a declaration like `private @A int x;` or `@A private int x;`,
there are three possibilities:
* `@A` is a declaration annotation on the field
* `@A` is a `TYPE_USE` annotation on the type
* `@A` sets `TYPE_USE` _and_ `FIELD` targets, and appears in the
bytecode as both a declaration annotation and as a type annotation
This can't be determined syntactically -- note that the presence of
other modifiers before or after the annotation has no bearing on whether
the annotation targets the type or the declaration.
So, we wait until constant binding is done, read the `@Target`
meta-annotation for each ambiguous annotation, and move it to the
appropriate location.
MOE_MIGRATED_REVID=137749757
|
|
Handle binding of type annotations, evaluation of type annotation
arguments, and lowering to bytecode for all type annotations kinds that
can appears in headers.
Currently type annotations are identified syntactically, we need to read
@Target to deal with ambiguous declarations on fields and method return
types (e.g. `@A int x;` could be `TYPE_USE` or `FIELD` or both).
MOE_MIGRATED_REVID=137566512
|
|
Instantiate types recursively; previously [T/e]A<T> worked but
[T/e]A<B<T>> didn't.
Also handle instantiating arrays with parametric element types, which
can't appear as top-level types during canonicalization but can appear
as type arguments (e.g. [T/e]A<T[]> -> A<e[]>).
The array instantiation case is interesting because it allows the
creation of arrays with wildcard element types. The JVMS signature
grammar [1] doesn't actually allow that, but both javac and ecj can be
coerced into emitting it:
class A<X> { class I {} }
class Test {
class B<Y> extends A<Y[]> {}
B<?>.I i; // LA<[*>.I;
}
To support this, restructure the type and signature models to make
wildcards first-class types, instead of only allowing them as top-level
type arguments.
[1] https://docs.oracle.com/javase/specs/jvms/se8/html/jvms-4.html#jvms-4.7.9.1
MOE_MIGRATED_REVID=137101539
|
|
Canonicalize qualified type names so qualifiers are always the declaring
class of the qualified type. For example, given:
```
class A<T> { class Inner {} }
class B extends A<String> {}
```
The type name `B.Inner` must be canonicalized as `A<String>.Inner` in bytecode.
MOE_MIGRATED_REVID=135300804
|