Re: RFR: 8285401: Proxy class initializer should use 3-arg `Class.forName` to avoid unnecessary class initialization [v2]

2022-05-20 Thread liach
On Fri, 20 May 2022 11:51:09 GMT, ExE Boss  wrote:

>> liach has updated the pull request incrementally with one additional commit 
>> since the last revision:
>> 
>>   remove unused field
>
> src/java.base/share/classes/java/lang/reflect/ProxyGenerator.java line 608:
> 
>> 606: mv.visitMethodInsn(INVOKEVIRTUAL, JL_CLASS,
>> 607: "getClassLoader", "()" + LJL_CLASSLOADER, false);
>> 608: mv.visitVarInsn(ASTORE, 0);
> 
> Shouldn’t this go before `mv.visitLabel(L_startBlock)`?

Done.

-

PR: https://git.openjdk.java.net/jdk/pull/8800


Re: RFR: 8285401: Proxy class initializer should use 3-arg `Class.forName` to avoid unnecessary class initialization [v2]

2022-05-20 Thread ExE Boss
On Fri, 20 May 2022 04:06:19 GMT, liach  wrote:

>> Simplify calls `Class.forName(String, boolean, ClassLoader)` instead of 
>> `Class.forName(String)`. `make test 
>> TEST="jtreg:test/jdk/java/lang/reflect/Proxy"` passes, with the new 
>> `LazyInitializationTest` failing the eager initialization check on the 
>> baseline and passing with this patch.
>> 
>> On a side note, this might reduce the number of methods that can be encoded 
>> in a proxy due to code attribute size restrictions; we probably would 
>> address that in another issue, as we never mandated a count of methods that 
>> the proxy must be able to implement.
>> 
>> Mandy, would you mind review this?
>
> liach has updated the pull request incrementally with one additional commit 
> since the last revision:
> 
>   remove unused field

src/java.base/share/classes/java/lang/reflect/ProxyGenerator.java line 608:

> 606: mv.visitMethodInsn(INVOKEVIRTUAL, JL_CLASS,
> 607: "getClassLoader", "()" + LJL_CLASSLOADER, false);
> 608: mv.visitVarInsn(ASTORE, 0);

Shouldn’t this go before `mv.visitLabel(L_startBlock)`?

-

PR: https://git.openjdk.java.net/jdk/pull/8800


Re: RFR: 8285401: Proxy class initializer should use 3-arg `Class.forName` to avoid unnecessary class initialization [v2]

2022-05-19 Thread liach
> Simplify calls `Class.forName(String, boolean, ClassLoader)` instead of 
> `Class.forName(String)`. `make test 
> TEST="jtreg:test/jdk/java/lang/reflect/Proxy"` passes, with the new 
> `LazyInitializationTest` failing the eager initialization check on the 
> baseline and passing with this patch.
> 
> On a side note, this might reduce the number of methods that can be encoded 
> in a proxy due to code attribute size restrictions; we probably would address 
> that in another issue, as we never mandated a count of methods that the proxy 
> must be able to implement.
> 
> Mandy, would you mind review this?

liach has updated the pull request incrementally with one additional commit 
since the last revision:

  remove unused field

-

Changes:
  - all: https://git.openjdk.java.net/jdk/pull/8800/files
  - new: https://git.openjdk.java.net/jdk/pull/8800/files/c1b522d5..64a70479

Webrevs:
 - full: https://webrevs.openjdk.java.net/?repo=jdk&pr=8800&range=01
 - incr: https://webrevs.openjdk.java.net/?repo=jdk&pr=8800&range=00-01

  Stats: 1 line in 1 file changed: 0 ins; 1 del; 0 mod
  Patch: https://git.openjdk.java.net/jdk/pull/8800.diff
  Fetch: git fetch https://git.openjdk.java.net/jdk pull/8800/head:pull/8800

PR: https://git.openjdk.java.net/jdk/pull/8800