Integrated: 8254022: [lworld] [type-restrictions] Initial support for RestrictedField

Frederic Parain fparain at openjdk.java.net
Tue Oct 6 18:31:22 UTC 2020


On Mon, 5 Oct 2020 14:59:38 GMT, Frederic Parain <fparain at openjdk.org> wrote:

> [Second attempt, trying to do it on the right branch this time]
> 
> Please review these changes adding an initial support for RestrictedField.
> 
> The patch includes:
>  - recognizing and processing the new attribute during class file parsing
>  - creating new meta-data to store both the erased type and the restricted type
>  - fixing all intermediate method dealing with field types (FieldInfo, FieldStream, etc)
>  - fixing field resolution to take into the two possible signatures of the fields
>  - adding checkcast against the restricted type in the interpreter implementation of putfield
> 
> The patch doesn't include:
>  - propagating new meta-data to CI
>  - adding new type checks in JIT generated code
> 
> The main take away of this first patch is that the VM mostly cares about the sharp type (from the
> RestrictedField attribute), and the only place where it needs knowledge of the erased type is for
> field resolution. This is why the implementation of the RestrictedField in the VM is inverted compared
> to the content of the class file: the traditional FieldInfo is filled with the sharp type from the RestrictedField
> attribute, while the original erased type is moved to a new variable section of InstanceKlass.
> 
> Note: the patch includes a serious clean up of the FieldInfo data structure. It used to store the allocation
> type of the field, but this information is not used anymore after the replacement of the old field layout
> code by the field layout builder. Removing the allocation type from the data structure simplifies it a lot.
> 
> Thank you,
> 
> Fred

This pull request has now been integrated.

Changeset: 3f60fc1b
Author:    Frederic Parain <fparain at openjdk.org>
URL:       https://git.openjdk.java.net/valhalla/commit/3f60fc1b
Stats:     393 lines in 18 files changed: 244 ins; 98 del; 51 mod

8254022: [lworld] [type-restrictions] Initial support for RestrictedField

Reviewed-by: dsimms

-------------

PR: https://git.openjdk.java.net/valhalla/pull/210



More information about the valhalla-dev mailing list