Re: RFR: 8342650: Move getChars to DecimalDigits [v3]

2024-11-05 Thread Shaojin Wen
ess > 3. Eliminate duplicate code in BigDecimal Shaojin Wen has updated the pull request incrementally with one additional commit since the last revision: remove comments, from @liach - Changes: - all: https://git.openjdk.org/jdk/pull/21593/files - new: https://git.openj

Re: RFR: 8342650: Move getChars to DecimalDigits [v2]

2024-11-05 Thread Shaojin Wen
On Wed, 6 Nov 2024 01:44:38 GMT, Chen Liang wrote: >> Shaojin Wen has updated the pull request with a new target base due to a >> merge or a rebase. The incremental webrev excludes the unrelated changes >> brought in by the merge/rebase. The pull request contains 11 addi

RFR: 8343650: Reuse StringLatin1::putCharsAt and StringUTF16::putCharsAt

2024-11-05 Thread Shaojin Wen
Reuse the optimized putCharsAt method of StringLatin1 and StringUTF16 in PR #19626 to simplify the code, eliminate boundary checks, and improve performance - Commit messages: - use StringLatin1::putCharsAt and StringUTF16::putCharsAt Changes: https://git.openjdk.org/jdk/pull/21907/

Re: RFR: 8337279: Optimize format instant [v10]

2024-11-05 Thread Shaojin Wen
> By removing the redundant code logic in > DateTimeFormatterBuilder$InstantPrinterParser#formatTo, the codeSize can be > reduced and the performance can be improved. Shaojin Wen has updated the pull request with a new target base due to a merge or a rebase. The incremental webrev exc

Re: RFR: 8342650: Move getChars to DecimalDigits [v2]

2024-11-05 Thread Shaojin Wen
ess > 3. Eliminate duplicate code in BigDecimal Shaojin Wen has updated the pull request with a new target base due to a merge or a rebase. The incremental webrev excludes the unrelated changes brought in by the merge/rebase. The pull request contains 11 additional commits since the last revis

Integrated: 8333893: Optimization for StringBuilder append boolean & null

2024-11-05 Thread Shaojin Wen
On Mon, 10 Jun 2024 12:12:58 GMT, Shaojin Wen wrote: > After PR https://github.com/openjdk/jdk/pull/16245, C2 optimizes stores into > primitive arrays by combining values ​​into larger stores. > > This PR rewrites the code of appendNull and append(boolean) methods so that > th

Re: RFR: 8333893: Optimization for StringBuilder append boolean & null [v20]

2024-11-05 Thread Shaojin Wen
On Fri, 18 Oct 2024 21:56:53 GMT, Shaojin Wen wrote: >> After PR https://github.com/openjdk/jdk/pull/16245, C2 optimizes stores into >> primitive arrays by combining values ​​into larger stores. >> >> This PR rewrites the code of appendNull and append(boolean) metho

Integrated: 8343500: Optimize ArrayClassDescImpl computeDescriptor

2024-11-04 Thread Shaojin Wen
On Sat, 2 Nov 2024 22:50:29 GMT, Shaojin Wen wrote: > A small improvement to ArrayClassDescImpl#computeDescriptor that avoids > intermediate object allocation in the common rank 1 scenario. This pull request has now been integrated. Changeset: 67907d5e Author:Shaojin We

RFR: 8343500: Optimize ArrayClassDescImpl computeDescriptor

2024-11-03 Thread Shaojin Wen
A small improvement to ArrayClassDescImpl#computeDescriptor that avoids intermediate object allocation in the common rank 1 scenario. - Commit messages: - optimize computeDescriptor Changes: https://git.openjdk.org/jdk/pull/21860/files Webrev: https://webrevs.openjdk.org/?repo=jd

Withdrawn: 8342644: Optimize InvokerBytecodeGenerator for using ClassFile API

2024-10-24 Thread Shaojin Wen
On Fri, 18 Oct 2024 10:01:59 GMT, Shaojin Wen wrote: > Cache commonly used classDesc to avoid creating ReferenceClassDescImpl every > time This pull request has been closed without being integrated. - PR: https://git.openjdk.org/jdk/pull/21580

Re: RFR: 8342700: Set the default value of DirectCodeBuilder::handlers to Null [v2]

2024-10-21 Thread Shaojin Wen
> Set the default value of DirectCodeBuilder::handlers to Null to reduce > overhead in scenarios where there is no handler. Shaojin Wen has updated the pull request incrementally with one additional commit since the last revision: List.of - Changes: - all:

RFR: 8342700: Set the default value of DirectCodeBuilder::handlers to Null

2024-10-21 Thread Shaojin Wen
Set the default value of DirectCodeBuilder::handlers to Null to reduce overhead in scenarios where there is no handler. - Commit messages: - handlers default null Changes: https://git.openjdk.org/jdk/pull/21598/files Webrev: https://webrevs.openjdk.org/?repo=jdk&pr=21598&range=00

Re: RFR: 8333893: Optimization for StringBuilder append boolean & null [v20]

2024-10-21 Thread Shaojin Wen
On Fri, 18 Oct 2024 21:56:53 GMT, Shaojin Wen wrote: >> After PR https://github.com/openjdk/jdk/pull/16245, C2 optimizes stores into >> primitive arrays by combining values ​​into larger stores. >> >> This PR rewrites the code of appendNull and append(boolean) metho

Re: RFR: 8333893: Optimization for StringBuilder append boolean & null [v20]

2024-10-20 Thread Shaojin Wen
On Fri, 18 Oct 2024 21:56:53 GMT, Shaojin Wen wrote: >> After PR https://github.com/openjdk/jdk/pull/16245, C2 optimizes stores into >> primitive arrays by combining values ​​into larger stores. >> >> This PR rewrites the code of appendNull and append(boolean) metho

Re: RFR: 8333893: Optimization for StringBuilder append boolean & null [v20]

2024-10-20 Thread Shaojin Wen
On Fri, 18 Oct 2024 21:56:53 GMT, Shaojin Wen wrote: >> After PR https://github.com/openjdk/jdk/pull/16245, C2 optimizes stores into >> primitive arrays by combining values ​​into larger stores. >> >> This PR rewrites the code of appendNull and append(boolean) metho

Re: RFR: 8342650: Move getChars to DecimalDigits

2024-10-20 Thread Shaojin Wen
On Sun, 20 Oct 2024 17:33:09 GMT, j3graham wrote: >> Move getChars methods of StringLatin1 and StringUTF16 to DecimalDigits to >> reduce duplication >> >> 1. HexDigits and OctalDigits also include getCharsLatin1 and getCharsUTF16 >> 2. Putting these two methods into DecimalDigits can avoid the

RFR: 8342650: Move getChars to DecimalDigits

2024-10-20 Thread Shaojin Wen
Move getChars methods of StringLatin1 and StringUTF16 to DecimalDigits to reduce duplication 1. HexDigits and OctalDigits also include getCharsLatin1 and getCharsUTF16 2. Putting these two methods into DecimalDigits can avoid the need to expose them in JavaLangAccess 3. Eliminate duplicate code

Re: RFR: 8333893: Optimization for StringBuilder append boolean & null [v20]

2024-10-20 Thread Shaojin Wen
On Fri, 18 Oct 2024 21:56:53 GMT, Shaojin Wen wrote: >> After PR https://github.com/openjdk/jdk/pull/16245, C2 optimizes stores into >> primitive arrays by combining values ​​into larger stores. >> >> This PR rewrites the code of appendNull and append(boolean) metho

Re: RFR: 8342644: Optimize InvokerBytecodeGenerator for using ClassFile API [v2]

2024-10-19 Thread Shaojin Wen
> Cache commonly used classDesc to avoid creating ReferenceClassDescImpl every > time Shaojin Wen has updated the pull request incrementally with one additional commit since the last revision: add LFI/NFI - Changes: - all: https://git.openjdk.org/jdk/pull/21580/files

Re: RFR: 8342644: Optimize InvokerBytecodeGenerator for using ClassFile API

2024-10-18 Thread Shaojin Wen
On Fri, 18 Oct 2024 13:32:57 GMT, Chen Liang wrote: >> Cache commonly used classDesc to avoid creating ReferenceClassDescImpl every >> time > > src/java.base/share/classes/java/lang/invoke/InvokerBytecodeGenerator.java > line 141: > >> 139: case "MH" -> CD_MH; >> 140:

RFR: 8342644: Optimize InvokerBytecodeGenerator for using ClassFile API

2024-10-18 Thread Shaojin Wen
Cache commonly used classDesc to avoid creating ReferenceClassDescImpl every time - Commit messages: - cache ClassDesc MH/BMH/DMH Changes: https://git.openjdk.org/jdk/pull/21580/files Webrev: https://webrevs.openjdk.org/?repo=jdk&pr=21580&range=00 Issue: https://bugs.openjdk.or

Re: RFR: 8333893: Optimization for StringBuilder append boolean & null [v20]

2024-10-18 Thread Shaojin Wen
On Fri, 18 Oct 2024 21:56:53 GMT, Shaojin Wen wrote: >> After PR https://github.com/openjdk/jdk/pull/16245, C2 optimizes stores into >> primitive arrays by combining values ​​into larger stores. >> >> This PR rewrites the code of appendNull and append(boolean) metho

Re: RFR: 8333893: Optimization for StringBuilder append boolean & null [v20]

2024-10-18 Thread Shaojin Wen
> After PR https://github.com/openjdk/jdk/pull/16245, C2 optimizes stores into > primitive arrays by combining values ​​into larger stores. > > This PR rewrites the code of appendNull and append(boolean) methods so that > these two methods can be optimized by C2. Shaojin Wen

Integrated: 8341664: ReferenceClassDescImpl cache internalName

2024-10-18 Thread Shaojin Wen
On Sun, 6 Oct 2024 01:22:33 GMT, Shaojin Wen wrote: > ReferenceClassDescImpl caches internalName to avoid creating a new String > object for each call, which can also simplify the implementation of classfile. This pull request has now been integrated. Changeset: 0963b9e8 Author:S

Re: RFR: 8341664: ReferenceClassDescImpl cache internalName [v6]

2024-10-17 Thread Shaojin Wen
> ReferenceClassDescImpl caches internalName to avoid creating a new String > object for each call, which can also simplify the implementation of classfile. Shaojin Wen has updated the pull request with a new target base due to a merge or a rebase. The incremental webrev excludes the unr

Integrated: 8342336: Optimize ClassFile imports

2024-10-17 Thread Shaojin Wen
On Sun, 13 Oct 2024 01:42:38 GMT, Shaojin Wen wrote: > This is a code style improvement for imports in the java/lang/classfile and > jdk/internal/classfile/impl directories, includes: > 1. Import in alphabetical order > 2. Add a blank line between java and jdk imports > 3. Use

Re: RFR: 8342336: Optimize ClassFile imports [v2]

2024-10-16 Thread Shaojin Wen
> This is a code style improvement for imports in the java/lang/classfile and > jdk/internal/classfile/impl directories, includes: > 1. Import in alphabetical order > 2. Add a blank line between java and jdk imports > 3. Use import * for a large number of imports Shaojin Wen has u

RFR: 8342336: Optimize ClassFile imports

2024-10-16 Thread Shaojin Wen
This is a code style improvement for imports in the java/lang/classfile and jdk/internal/classfile/impl directories, includes: 1. Import in alphabetical order 2. Add a blank line between java and jdk imports 3. Use import * for a large number of imports - Commit messages: - optimize

Re: RFR: 8341664: ReferenceClassDescImpl cache internalName [v5]

2024-10-10 Thread Shaojin Wen
> ReferenceClassDescImpl caches internalName to avoid creating a new String > object for each call, which can also simplify the implementation of classfile. Shaojin Wen has updated the pull request with a new target base due to a merge or a rebase. The incremental webrev excludes the unr

Integrated: 8341900: Optimize DirectCodeBuilder writeBody

2024-10-10 Thread Shaojin Wen
On Thu, 10 Oct 2024 03:55:34 GMT, Shaojin Wen wrote: > A simple optimization to reduce duplicate code. Reduce the codeSize of > writeBody from 268 to 240 This pull request has now been integrated. Changeset: 472db922 Author:Shaojin Wen URL: https://git.openjdk.org/jdk/

Integrated: 8341906: Optimize ClassFile writing BufBuffer

2024-10-10 Thread Shaojin Wen
On Thu, 10 Oct 2024 01:13:13 GMT, Shaojin Wen wrote: > We made a lot of improvements to merge writes to BufWriter in #21243, and > this PR is about doing more of the same. This pull request has now been integrated. Changeset: 24eb3601 Author:Shaojin Wen URL:

Re: RFR: 8341664: ReferenceClassDescImpl cache internalName [v4]

2024-10-10 Thread Shaojin Wen
> ReferenceClassDescImpl caches internalName to avoid creating a new String > object for each call, which can also simplify the implementation of classfile. Shaojin Wen has updated the pull request with a new target base due to a merge or a rebase. The incremental webrev excludes the unr

Integrated: 8341136: Optimize StackMapGenerator::trimAndCompress

2024-10-10 Thread Shaojin Wen
On Fri, 27 Sep 2024 17:05:25 GMT, Shaojin Wen wrote: > A small optimization to reduce the write operations of trimAndCompress This pull request has now been integrated. Changeset: 6e013845 Author: Shaojin Wen URL: https://git.openjdk.org/jdk/com

Re: RFR: 8341664: ReferenceClassDescImpl cache internalName [v3]

2024-10-10 Thread Shaojin Wen
> ReferenceClassDescImpl caches internalName to avoid creating a new String > object for each call, which can also simplify the implementation of classfile. Shaojin Wen has updated the pull request with a new target base due to a merge or a rebase. The incremental webrev excludes the unr

Integrated: 8339205: Optimize StackMapGenerator

2024-10-10 Thread Shaojin Wen
On Wed, 28 Aug 2024 22:20:25 GMT, Shaojin Wen wrote: > Reduce code size by combining calls and defining local variables This pull request has now been integrated. Changeset: e9327b6e Author: Shaojin Wen URL: https://git.openjdk.org/jdk/commit/e9327b6e3c1fcc47ec790fa4e4019f7651a8f

RFR: 8341906: Optimize ClassFile writing BufBuffer

2024-10-10 Thread Shaojin Wen
We made a lot of improvements to merge writes to BufWriter in #21243, and this PR is about doing more of the same. - Commit messages: - merge write Changes: https://git.openjdk.org/jdk/pull/21437/files Webrev: https://webrevs.openjdk.org/?repo=jdk&pr=21437&range=00 Issue: https

RFR: 8341900: Optimize DirectCodeBuilder writeBody

2024-10-10 Thread Shaojin Wen
A simple optimization to reduce duplicate code. Reduce the codeSize of writeBody from 268 to 240 - Commit messages: - optimize writeBody Changes: https://git.openjdk.org/jdk/pull/21440/files Webrev: https://webrevs.openjdk.org/?repo=jdk&pr=21440&range=00 Issue: https://bugs.ope

Re: RFR: 8341664: ReferenceClassDescImpl cache internalName [v2]

2024-10-09 Thread Shaojin Wen
> ReferenceClassDescImpl caches internalName to avoid creating a new String > object for each call, which can also simplify the implementation of classfile. Shaojin Wen has updated the pull request with a new target base due to a merge or a rebase. The incremental webrev excludes the unr

Integrated: 8341859: Optimize ClassFile Benchmark Write

2024-10-09 Thread Shaojin Wen
On Wed, 9 Oct 2024 17:17:36 GMT, Shaojin Wen wrote: > Cache method names to reduce the overhead of using StringBuilder to construct > method names, which will make the performance test results more stable. This pull request has now been integrated. Changeset: 475f8f94 Author:Shaoj

Integrated: 8341755: Optimize argNames in InnerClassLambdaMetafactory

2024-10-09 Thread Shaojin Wen
On Tue, 8 Oct 2024 00:47:27 GMT, Shaojin Wen wrote: > A simple optimization that eliminates the allocation of the > MethodTypeDescImpl object when parameterCount is equal to 0 and eliminates > the allocation of argNames when parameterCount is equal to 1 This pull request has

RFR: 8341859: Optimize ClassFile Benchmark Write

2024-10-09 Thread Shaojin Wen
Cache method names to reduce the overhead of using StringBuilder to construct method names, which will make the performance test results more stable. - Commit messages: - cache methodName Changes: https://git.openjdk.org/jdk/pull/21425/files Webrev: https://webrevs.openjdk.org/?r

Re: RFR: 8339205: Optimize StackMapGenerator [v7]

2024-10-09 Thread Shaojin Wen
> Reduce code size by combining calls and defining local variables Shaojin Wen has updated the pull request with a new target base due to a merge or a rebase. The pull request now contains 18 commits: - Merge remote-tracking branch 'upstream/master' into optim_stack_map_gen_20

Re: RFR: 8339205: Optimize StackMapGenerator [v6]

2024-10-09 Thread Shaojin Wen
> Reduce code size by combining calls and defining local variables Shaojin Wen has updated the pull request incrementally with one additional commit since the last revision: use 4 spaces. - Changes: - all: https://git.openjdk.org/jdk/pull/20756/files - new: ht

Re: RFR: 8339205: Optimize StackMapGenerator [v5]

2024-10-09 Thread Shaojin Wen
> Reduce code size by combining calls and defining local variables Shaojin Wen has updated the pull request incrementally with one additional commit since the last revision: Update src/java.base/share/classes/jdk/internal/classfile/impl/StackMapGenerator.java Co-authored-by: Chen Li

Integrated: 8339320: Optimize ClassFile Utf8EntryImpl#inflate

2024-10-09 Thread Shaojin Wen
On Thu, 29 Aug 2024 11:44:50 GMT, Shaojin Wen wrote: > A very small optimization, split the large method inflate, split the > infrequently used paths into a method inflateCHAR This pull request has now been integrated. Changeset: a24525b6 Author:Shaojin Wen URL:

Integrated: 8341141: Optimize DirectCodeBuilder

2024-10-09 Thread Shaojin Wen
On Sun, 29 Sep 2024 00:02:38 GMT, Shaojin Wen wrote: > Some DirectCodeBuilder related optimizations to improve startup and running > performance: > 1. Merge calls, merge writeU1 and writeU2 into writeU3 > 2. Merge calls, merge writeU1 and writeIndex operations > 3. Directly use

Re: RFR: 8341755: Optimize argNames in InnerClassLambdaMetafactory [v7]

2024-10-08 Thread Shaojin Wen
On Wed, 9 Oct 2024 04:20:17 GMT, Chen Liang wrote: > Back to precomputed constants :) Manual shift computation! The code is also simplified based on precomputed constants. - PR Comment: https://git.openjdk.org/jdk/pull/21399#issuecomment-2401334988

Re: RFR: 8341755: Optimize argNames in InnerClassLambdaMetafactory [v7]

2024-10-08 Thread Shaojin Wen
> A simple optimization that eliminates the allocation of the > MethodTypeDescImpl object when parameterCount is equal to 0 and eliminates > the allocation of argNames when parameterCount is equal to 1 Shaojin Wen has updated the pull request incrementally with one additional commit

Re: RFR: 8341755: Optimize argNames in InnerClassLambdaMetafactory [v6]

2024-10-08 Thread Shaojin Wen
> A simple optimization that eliminates the allocation of the > MethodTypeDescImpl object when parameterCount is equal to 0 and eliminates > the allocation of argNames when parameterCount is equal to 1 Shaojin Wen has updated the pull request incrementally with one additional commit

Re: RFR: 8341141: Optimize DirectCodeBuilder [v24]

2024-10-08 Thread Shaojin Wen
On Tue, 8 Oct 2024 22:32:24 GMT, Chen Liang wrote: >> src/java.base/share/classes/jdk/internal/classfile/impl/DirectCodeBuilder.java >> line 706: >> >>> 704: public void writeLoadConstant(Opcode opcode, LoadableConstantEntry >>> value) { >>> 705: // Make sure Long and Double have L

Re: RFR: 8341755: Optimize argNames in InnerClassLambdaMetafactory [v5]

2024-10-08 Thread Shaojin Wen
> A simple optimization that eliminates the allocation of the > MethodTypeDescImpl object when parameterCount is equal to 0 and eliminates > the allocation of argNames when parameterCount is equal to 1 Shaojin Wen has updated the pull request incrementally with one additional commit

Re: RFR: 8341141: Optimize DirectCodeBuilder [v25]

2024-10-08 Thread Shaojin Wen
On Tue, 8 Oct 2024 22:15:23 GMT, Claes Redestad wrote: > LGTM. > > I spotted places outside of the DirectCodeBuilder paths that could benefit > from using these new coalescing writers, but write-only cases is a good focus > point for now. Are you talking about merging multiple writeU2 in plac

Re: RFR: 8341141: Optimize DirectCodeBuilder [v26]

2024-10-08 Thread Shaojin Wen
implementation of load and store Shaojin Wen has updated the pull request incrementally with one additional commit since the last revision: fix comment - Changes: - all: https://git.openjdk.org/jdk/pull/21243/files - new: https://git.openjdk.org/jdk/pull/21243/files/cd597a2a.

Re: RFR: 8341755: Optimize argNames in InnerClassLambdaMetafactory [v4]

2024-10-08 Thread Shaojin Wen
> A simple optimization that eliminates the allocation of the > MethodTypeDescImpl object when parameterCount is equal to 0 and eliminates > the allocation of argNames when parameterCount is equal to 1 Shaojin Wen has updated the pull request with a new target base due to a merge or

Integrated: 8341548: More concise use of classfile API

2024-10-08 Thread Shaojin Wen
On Fri, 4 Oct 2024 12:05:02 GMT, Shaojin Wen wrote: > java.base should provide best practices for Class File API > > 1. Use fluent coding style > 2. Use aconst_null instead of oadConstant(null) > 3. use astore intead of 'storeLocal(REFERENCE' > 4. use aload instead

Re: RFR: 8341755: Optimize argNames in InnerClassLambdaMetafactory [v3]

2024-10-08 Thread Shaojin Wen
> A simple optimization that eliminates the allocation of the > MethodTypeDescImpl object when parameterCount is equal to 0 and eliminates > the allocation of argNames when parameterCount is equal to 1 Shaojin Wen has updated the pull request incrementally with one additional commit

Re: RFR: 8341755: Optimize argNames in InnerClassLambdaMetafactory [v2]

2024-10-08 Thread Shaojin Wen
> A simple optimization that eliminates the allocation of the > MethodTypeDescImpl object when parameterCount is equal to 0 and eliminates > the allocation of argNames when parameterCount is equal to 1 Shaojin Wen has updated the pull request incrementally with one additional commit

RFR: 8341755: Optimize argNames in InnerClassLambdaMetafactory

2024-10-08 Thread Shaojin Wen
A simple optimization that eliminates the allocation of the MethodTypeDescImpl object when parameterCount is equal to 0 and eliminates the allocation of argNames when parameterCount is equal to 1 - Commit messages: - Use global cache, don't need per-instance array - Merge remote-t

Re: RFR: 8341141: Optimize DirectCodeBuilder [v25]

2024-10-08 Thread Shaojin Wen
implementation of load and store Shaojin Wen has updated the pull request incrementally with four additional commits since the last revision: - Fold opcode.bytecode() in writeLoadConstant - A few missed places, U1U2U2 seem common enough too to be included - Rename writeUtfEntry - Fold TAG_UTF8 w

Re: RFR: 8341594: Use Unsafe to coalesce reads in java.util.zip.ZipUtils [v4]

2024-10-07 Thread Shaojin Wen
On Sun, 6 Oct 2024 21:45:08 GMT, Claes Redestad wrote: >> #14632 showed that coalescing loads in the `ZipUtils` utility methods could >> improve performance in zip-related microbenchmarks, but doing so would >> increase startup overheads. Progress was stalled as we backed out some >> related e

Integrated: 8341581: Optimize BytecodeHelpers validate slot

2024-10-07 Thread Shaojin Wen
On Fri, 4 Oct 2024 23:49:42 GMT, Shaojin Wen wrote: > Use `slot & ~0xFF == 0` instead of `(slot & 0xFF) == slot` to reduce codeSize. > > The following is a comparison of the bytecode before and after the > modification. It can be seen that using `slot & ~0xFF == 0`

Re: RFR: 8341141: Optimize DirectCodeBuilder [v24]

2024-10-07 Thread Shaojin Wen
implementation of load and store Shaojin Wen has updated the pull request incrementally with one additional commit since the last revision: suggestion from @liach - Changes: - all: https://git.openjdk.org/jdk/pull/21243/files - new: https://git.openjdk.org/jdk/pull/21243/files/

RFR: 8341664: ReferenceClassDescImpl cache internalName

2024-10-07 Thread Shaojin Wen
ReferenceClassDescImpl caches internalName to avoid creating a new String object for each call, which can also simplify the implementation of classfile. - Commit messages: - suggestion from @liach - stable - ReferenceClassDescImpl cache internalName Changes: https://git.openjdk.o

Re: RFR: 8341664: ReferenceClassDescImpl cache internalName

2024-10-07 Thread Shaojin Wen
On Sun, 6 Oct 2024 01:22:33 GMT, Shaojin Wen wrote: > ReferenceClassDescImpl caches internalName to avoid creating a new String > object for each call, which can also simplify the implementation of classfile. In many scenarios where classfile is used, ClassDesc is cached by stat

Re: RFR: 8341548: More concise use of classfile API [v3]

2024-10-06 Thread Shaojin Wen
lstore' instead of 'loadLocal(LONG)/storeLocal(LONG)' Shaojin Wen has updated the pull request incrementally with one additional commit since the last revision: more fluent coding style - Changes: - all: https://git.openjdk.org/jdk/pull/21355/files - new: ht

Re: RFR: 8339704: Refactor StringConcatHelper simpleConcat [v7]

2024-10-06 Thread Shaojin Wen
On Tue, 10 Sep 2024 13:13:22 GMT, Shaojin Wen wrote: >> The string concatenation of the java.base module is implemented using >> StringBuilder. By providing a series of concat methods in >> StringConcatHelper, it is used in the java.lang package to replace string

RFR: 8341581: Optimize BytecodeHelpers validate slot

2024-10-05 Thread Shaojin Wen
Use `slot & ~0xFF == 0` instead of `(slot & 0xFF) == slot` to reduce codeSize. The following is a comparison of the bytecode before and after the modification. It can be seen that using `slot & ~0xFF == 0` will reduce one iload operation. // (slot & 0xFF) == slot 56: iload_0 57: sipush

Re: RFR: 8341141: Optimize DirectCodeBuilder [v23]

2024-10-05 Thread Shaojin Wen
implementation of load and store Shaojin Wen has updated the pull request incrementally with one additional commit since the last revision: fix merge error - Changes: - all: https://git.openjdk.org/jdk/pull/21243/files - new: https://git.openjdk.org/jdk/pull/21243/files/d4752d5f.

Re: RFR: 8341141: Optimize DirectCodeBuilder [v22]

2024-10-05 Thread Shaojin Wen
implementation of load and store Shaojin Wen has updated the pull request with a new target base due to a merge or a rebase. The pull request now contains 81 commits: - Merge branch 'master' into optim_direct_code_builder_202409 - Merge remote-tracking branch 'upstream/master'

Re: RFR: 8339205: Optimize StackMapGenerator [v4]

2024-10-05 Thread Shaojin Wen
> Reduce code size by combining calls and defining local variables Shaojin Wen has updated the pull request with a new target base due to a merge or a rebase. The pull request now contains 15 commits: - Merge branch 'master' into optim_stack_map_gen_202408 - Merge branch

Integrated: 8341512: Optimize StackMapGenerator::processInvokeInstructions

2024-10-05 Thread Shaojin Wen
On Fri, 4 Oct 2024 02:15:51 GMT, Shaojin Wen wrote: > A small optimization for StackMapGenerator::processInvokeInstructions. > > 1. Use local currentFrame to avoid multiple getfields > 2. remove Util.methodTypeSymbol(NameAndTypeEntry) > 3. Use decStack instead of popStack to redu

Re: RFR: 8341141: Optimize DirectCodeBuilder [v21]

2024-10-05 Thread Shaojin Wen
implementation of load and store Shaojin Wen has updated the pull request with a new target base due to a merge or a rebase. The pull request now contains 80 commits: - Merge remote-tracking branch 'upstream/master' into optim_direct_code_builder_202409 - Update src/java.base/share/cl

Re: RFR: 8339205: Optimize StackMapGenerator [v3]

2024-10-04 Thread Shaojin Wen
> Reduce code size by combining calls and defining local variables Shaojin Wen has updated the pull request with a new target base due to a merge or a rebase. The pull request now contains 14 commits: - Merge branch 'master' into optim_stack_map_gen_202408 - reduce codeSize - re

Integrated: 8341510: Optimize StackMapGenerator::processFieldInstructions

2024-10-04 Thread Shaojin Wen
On Fri, 4 Oct 2024 02:47:12 GMT, Shaojin Wen wrote: > A small optimization to reduce CodeSize, codeSize reduced from 164 to 140. > > 1. Use local currentFrame to avoid multiple getfields > 2. Use decStack instead of popStack to reduce array access in popStack > 3. Call Util.fie

Re: RFR: 8341512: Optimize StackMapGenerator::processInvokeInstructions [v3]

2024-10-04 Thread Shaojin Wen
ed from 277 to 262 Shaojin Wen has updated the pull request with a new target base due to a merge or a rebase. The pull request now contains five commits: - Merge branch 'master' into optim_classfile_stack_map_process_invoke_202410 - Update src/java.base/share/classes/j

Re: RFR: 8341548: More concise use of classfile API [v2]

2024-10-04 Thread Shaojin Wen
lstore' instead of 'loadLocal(LONG)/storeLocal(LONG)' Shaojin Wen has updated the pull request incrementally with one additional commit since the last revision: more fluent coding style - Changes: - all: https://git.openjdk.org/jdk/pull/21355/files - new: ht

Integrated: 8339699: Optimize DataOutputStream writeUTF

2024-10-04 Thread Shaojin Wen
On Fri, 6 Sep 2024 09:58:58 GMT, Shaojin Wen wrote: > PR #20772 introduced an optimization for writeUTF, which can also be used in > DataOutputStream::writeUTF. This pull request has now been integrated. Changeset: b42fbf43 Author:Shaojin Wen URL: https://git.openjdk.o

Re: RFR: 8341548: More concise use of classfile API

2024-10-04 Thread Shaojin Wen
On Fri, 4 Oct 2024 12:05:02 GMT, Shaojin Wen wrote: > java.base should provide best practices for Class File API > > 1. Use fluent coding style > 2. Use aconst_null instead of oadConstant(null) > 3. use astore intead of 'storeLocal(REFERENCE' > 4. use aload instead

RFR: 8341548: More concise use of classfile API

2024-10-04 Thread Shaojin Wen
java.base should provide best practices for Class File API 1. Use fluent coding style 2. Use aconst_null instead of oadConstant(null) 3. use astore intead of 'storeLocal(REFERENCE' 4. use aload instead of 'loadLocal(REFERENCE' 5. 'lload/lstore' instead of 'loadLocal(LONG)/storeLocal(LONG)' --

Re: RFR: 8339320: Optimize ClassFile Utf8EntryImpl#inflate [v4]

2024-10-04 Thread Shaojin Wen
> A very small optimization, split the large method inflate, split the > infrequently used paths into a method inflateCHAR Shaojin Wen has updated the pull request incrementally with one additional commit since the last revision: Update src/java.base/share/classes/jdk/internal/cla

Re: RFR: 8341470: BigDecimal.stripTrailingZeros() optimization [v18]

2024-10-04 Thread Shaojin Wen
On Fri, 4 Oct 2024 14:12:16 GMT, fabioromano1 wrote: >> An optimized algorithm for `BigDecimal.stripTrailingZeros()` that uses >> repeated squares trick. > > fabioromano1 has updated the pull request incrementally with two additional > commits since the last revision: > > - Merge branch 'patc

Re: RFR: 8339320: Optimize ClassFile Utf8EntryImpl#inflate [v3]

2024-10-04 Thread Shaojin Wen
On Wed, 25 Sep 2024 01:10:04 GMT, Shaojin Wen wrote: >> A very small optimization, split the large method inflate, split the >> infrequently used paths into a method inflateCHAR > > Shaojin Wen has updated the pull request with a new target base due to a > merge or a reb

Re: RFR: 8341512: Optimize StackMapGenerator::processInvokeInstructions [v2]

2024-10-04 Thread Shaojin Wen
ed from 277 to 262 Shaojin Wen has updated the pull request incrementally with one additional commit since the last revision: Update src/java.base/share/classes/java/lang/classfile/attribute/EnclosingMethodAttribute.java Co-authored-by: ExE Boss <3889017+exe-b...@use

Re: RFR: 8339205: Optimize StackMapGenerator [v2]

2024-10-04 Thread Shaojin Wen
> Reduce code size by combining calls and defining local variables Shaojin Wen has updated the pull request with a new target base due to a merge or a rebase. The pull request now contains 13 commits: - reduce codeSize - reduce codeSize - decStack & stackUnderflow - fix merge error

Re: RFR: 8341510: Optimize StackMapGenerator::processFieldInstructions

2024-10-04 Thread Shaojin Wen
On Fri, 4 Oct 2024 04:59:04 GMT, Chen Liang wrote: >> A small optimization to reduce CodeSize, codeSize reduced from 164 to 140. >> >> 1. Use local currentFrame to avoid multiple getfields >> 2. Use decStack instead of popStack to reduce array access in popStack >> 3. Call Util.fieldTypeSymbol t

RFR: 8341512: Optimize StackMapGenerator::processInvokeInstructions

2024-10-03 Thread Shaojin Wen
A small optimization for StackMapGenerator::processInvokeInstructions. 1. Use local currentFrame to avoid multiple getfields 2. remove Util.methodTypeSymbol(NameAndTypeEntry) 3. Use decStack instead of popStack to reduce array access in popStack 4. codeSize reduced from 277 to 262 -

RFR: 8341510: Optimize StackMapGenerator::processFieldInstructions

2024-10-03 Thread Shaojin Wen
A small optimization to reduce CodeSize, codeSize reduced from 164 to 140. 1. Use local currentFrame to avoid multiple getfields 2. Use decStack instead of popStack to reduce array access in popStack 3. Call Util.fieldTypeSymbol to pass in type instead of nameAndType - Commit message

Re: RFR: 8341141: Optimize DirectCodeBuilder [v20]

2024-10-03 Thread Shaojin Wen
implementation of load and store Shaojin Wen has updated the pull request incrementally with one additional commit since the last revision: Update src/java.base/share/classes/jdk/internal/classfile/impl/AttributeHolder.java Co-authored-by: Chen Liang - Changes: - all: https

Integrated: 8341006: Optimize StackMapGenerator detect frames

2024-10-03 Thread Shaojin Wen
On Wed, 25 Sep 2024 12:05:02 GMT, Shaojin Wen wrote: > 1. Construct Frames directly without BitSet > 2. Use Frame[] instead of ArrayList > 3. Use EMPTY_FRAME_ARRAY for initialization. No need to allocate objects when > there is no frame. This pull request has now been integrated

Re: RFR: 8341006: Optimize StackMapGenerator detect frames [v3]

2024-10-03 Thread Shaojin Wen
> 1. Construct Frames directly without BitSet > 2. Use Frame[] instead of ArrayList > 3. Use EMPTY_FRAME_ARRAY for initialization. No need to allocate objects when > there is no frame. Shaojin Wen has updated the pull request incrementally with one additional commit since the l

Integrated: 8341415: Optimize RawBytecodeHelper::next

2024-10-03 Thread Shaojin Wen
On Wed, 2 Oct 2024 07:53:44 GMT, Shaojin Wen wrote: > A small optimization to the RawBytecodeHelper::next method > * Remove `len <= 0` once > * merge store opcode and isWide This pull request has now been integrated. Changeset: d7f32d89 Author: Shaojin Wen URL:

Re: RFR: 8341415: Optimize RawBytecodeHelper::next

2024-10-02 Thread Shaojin Wen
On Wed, 2 Oct 2024 13:28:24 GMT, Shaojin Wen wrote: >> src/java.base/share/classes/jdk/internal/classfile/impl/RawBytecodeHelper.java >> line 350: >> >>> 348: */ >>> 349: public boolean isWide() { >>> 350: return (

Re: RFR: 8341415: Optimize RawBytecodeHelper::next

2024-10-02 Thread Shaojin Wen
On Wed, 2 Oct 2024 11:09:52 GMT, ExE Boss wrote: >> A small optimization to the RawBytecodeHelper::next method >> * Remove `len <= 0` once >> * merge store opcode and isWide > > src/java.base/share/classes/jdk/internal/classfile/impl/RawBytecodeHelper.java > line 350: > >> 348: */ >> 349:

RFR: 8341415: Optimize RawBytecodeHelper::next

2024-10-02 Thread Shaojin Wen
A small optimization to the RawBytecodeHelper::next method * Remove `len <= 0` once * merge store opcode and isWide - Commit messages: - merge store opcode & isWide - optimize RawBytecodeHelper::next Changes: https://git.openjdk.org/jdk/pull/21300/files Webrev: https://webrevs.op

Re: RFR: 8341141: Optimize DirectCodeBuilder [v19]

2024-10-01 Thread Shaojin Wen
implementation of load and store Shaojin Wen has updated the pull request incrementally with one additional commit since the last revision: fix merge error - Changes: - all: https://git.openjdk.org/jdk/pull/21243/files - new: https://git.openjdk.org/jdk/pull/21243/files/6dfa07ed.

Re: RFR: 8341141: Optimize DirectCodeBuilder [v18]

2024-10-01 Thread Shaojin Wen
implementation of load and store Shaojin Wen has updated the pull request with a new target base due to a merge or a rebase. The pull request now contains 77 commits: - Merge branch 'master' into optim_direct_code_builder_202409 - optimize DirectClassBuilder::build - writeU2U2U2 -

Re: RFR: 8341141: Optimize DirectCodeBuilder [v17]

2024-10-01 Thread Shaojin Wen
implementation of load and store Shaojin Wen has updated the pull request incrementally with two additional commits since the last revision: - optimize DirectClassBuilder::build - writeU2U2U2 - Changes: - all: https://git.openjdk.org/jdk/pull/21243/files - new: https://git.op

Re: RFR: 8341141: Optimize DirectCodeBuilder [v16]

2024-10-01 Thread Shaojin Wen
implementation of load and store Shaojin Wen has updated the pull request incrementally with one additional commit since the last revision: optimization for powerOctal - Changes: - all: https://git.openjdk.org/jdk/pull/21243/files - new: https://git.openjdk.org/jdk/pull/21

Re: RFR: 8341141: Optimize DirectCodeBuilder [v15]

2024-10-01 Thread Shaojin Wen
implementation of load and store Shaojin Wen has updated the pull request incrementally with two additional commits since the last revision: - label write clean - optimizer for codeSize - Changes: - all: https://git.openjdk.org/jdk/pull/21243/files - new: https://git.openjdk.

Re: RFR: 8341141: Optimize DirectCodeBuilder [v14]

2024-09-30 Thread Shaojin Wen
implementation of load and store Shaojin Wen has updated the pull request incrementally with two additional commits since the last revision: - optimize MethodTypeDescImpl::descriptorString - Remove redundant requireNonNull - Changes: - all: https://git.openjdk.org/jdk/pull/21243/fi

  1   2   3   4   5   6   7   8   >