Re: RFR: 8342206: Convenience method to check if a ClassEntry matches a ClassDesc [v4]

2024-10-30 Thread Chen Liang
> Currently, to efficiently check if a `ClassEntry`, such as one from an > `InvokeInstruction`, is of a particular class, we use such a pattern (as seen > in JEP 486 [Appendix](https://openjdk.org/jeps/486#Appendix)): > > inst.owner().name().equalsString("java/lang/System") > > This pattern has

Re: RFR: 8342206: Convenience method to check if a ClassEntry matches a ClassDesc [v3]

2024-10-22 Thread Chen Liang
On Tue, 22 Oct 2024 22:58:10 GMT, ExE Boss wrote: > I think it might be a good idea to also have `equalsSymbol(…)` methods for  > the other pool entries. Indeed, this can avoid promotion to String state for all applicable symbols. I decide to start with the ClassEntry as this is the most error-

Re: RFR: 8342206: Convenience method to check if a ClassEntry matches a ClassDesc [v3]

2024-10-22 Thread ExE Boss
On Tue, 22 Oct 2024 14:43:14 GMT, Chen Liang wrote: >> Currently, to efficiently check if a `ClassEntry`, such as one from an >> `InvokeInstruction`, is of a particular class, we use such a pattern (as >> seen in JEP 486 [Appendix](https://openjdk.org/jeps/486#Appendix)): >> >> inst.owner().na

Re: RFR: 8342206: Convenience method to check if a ClassEntry matches a ClassDesc [v3]

2024-10-22 Thread Chen Liang
> Currently, to efficiently check if a `ClassEntry`, such as one from an > `InvokeInstruction`, is of a particular class, we use such a pattern (as seen > in JEP 486 [Appendix](https://openjdk.org/jeps/486#Appendix)): > > inst.owner().name().equalsString("java/lang/System") > > This pattern has

Re: RFR: 8342206: Convenience method to check if a ClassEntry matches a ClassDesc [v2]

2024-10-16 Thread Chen Liang
On Wed, 16 Oct 2024 05:58:08 GMT, Chen Liang wrote: >> src/java.base/share/classes/jdk/internal/classfile/impl/AbstractPoolEntry.java >> line 609: >> >>> 607: var mySym = this.sym; >>> 608: if (mySym != null) >>> 609: return mySym.equals(symbol); >> >> N

Re: RFR: 8342206: Convenience method to check if a ClassEntry matches a ClassDesc [v2]

2024-10-16 Thread Chen Liang
> Currently, to efficiently check if a `ClassEntry`, such as one from an > `InvokeInstruction`, is of a particular class, we use such a pattern (as seen > in JEP 486 [Appendix](https://openjdk.org/jeps/486#Appendix)): > > inst.owner().name().equalsString("java/lang/System") > > This pattern has

Re: RFR: 8342206: Convenience method to check if a ClassEntry matches a ClassDesc

2024-10-15 Thread ExE Boss
On Tue, 15 Oct 2024 17:34:53 GMT, Chen Liang wrote: > Currently, to efficiently check if a `ClassEntry`, such as one from an > `InvokeInstruction`, is of a particular class, we use such a pattern (as seen > in JEP 486 [Appendix](https://openjdk.org/jeps/486#Appendix)): > > inst.owner().name().

RFR: 8342206: Convenience method to check if a ClassEntry matches a ClassDesc

2024-10-15 Thread Chen Liang
Currently, to efficiently check if a `ClassEntry`, such as one from an `InvokeInstruction`, is of a particular class, we use such a pattern (as seen in JEP 486 [Appendix](https://openjdk.org/jeps/486#Appendix)): inst.owner().name().equalsString("java/lang/System") This pattern has a few issues: