hg: amber/amber: adding method Class::isRecord
forax at univ-mlv.fr
forax at univ-mlv.fr
Thu Jul 12 20:29:15 UTC 2018
Thinking a little bit more about record and the abstract class AbstractRecord,
the problem with the presence of AbstractRecord is that it means can not have 'value record', a record which are value class because a value class can not inherits from an abstract class.
Rémi
> De: "Vicente Romero" <vicente.romero at oracle.com>
> À: "Brian Goetz" <brian.goetz at oracle.com>, "Remi Forax" <forax at univ-mlv.fr>
> Cc: "amber-dev" <amber-dev at openjdk.java.net>
> Envoyé: Mercredi 11 Juillet 2018 23:58:26
> Objet: Re: hg: amber/amber: adding method Class::isRecord
> On 07/11/2018 05:08 PM, Brian Goetz wrote:
>> I don’t think burning an ACC_RECORD flag is a terribly good use of some very
>> expensive real estate.
>> But, I had a different wonder: why not just do this from the Java side as:
>> boolean isRecord() { return AbstractRecord.class.isAssignableFrom(this); }
> yep that was what Paul also suggested in an offline conversation. I have
> reversed the original patch and applied redone this as:
> public boolean isRecord() { return this .getSuperclass() ==
> java.lang.AbstractRecord. class ;
> }
> Vicente
>> ?
>>> On Jul 11, 2018, at 4:54 PM, Remi Forax [ mailto:forax at univ-mlv.fr |
>>> <forax at univ-mlv.fr> ] wrote:
>>> Hi Vicente,
>>> usually for the Java side (Class.java), to avoid a native call, one of the bit
>>> of the class modifier flags, let's call it ACC_RECORD is reserved.
>>> Rémi
>>> ----- Mail original -----
>>>> De: "Vicente Romero" [ mailto:vicente.romero at oracle.com |
>>>> <vicente.romero at oracle.com> ] À: "amber-dev" [
>>>> mailto:amber-dev at openjdk.java.net | <amber-dev at openjdk.java.net> ] Envoyé:
>>>> Mercredi 11 Juillet 2018 22:28:10
>>>> Objet: hg: amber/amber: adding method Class::isRecord
>>>> Changeset: 2c5938e024ed
>>>> Author: vromero
>>>> Date: 2018-07-11 13:02 -0700
>>>> URL: [ http://hg.openjdk.java.net/amber/amber/rev/2c5938e024ed |
>>>> http://hg.openjdk.java.net/amber/amber/rev/2c5938e024ed ] adding method
>>>> Class::isRecord
>>>> ! make/hotspot/symbols/symbols-unix
>>>> ! src/hotspot/share/classfile/systemDictionary.hpp
>>>> ! src/hotspot/share/classfile/vmSymbols.hpp
>>>> ! src/hotspot/share/include/jvm.h
>>>> ! src/hotspot/share/oops/klass.cpp
>>>> ! src/hotspot/share/oops/klass.hpp
>>>> ! src/hotspot/share/prims/jvm.cpp
>>>> ! src/java.base/share/classes/java/lang/Class.java
>>>> ! src/java.base/share/native/libjava/Class.c
More information about the amber-dev
mailing list