On Wed, 28 Aug 2024 13:16:03 GMT, Shaojin Wen wrote:
> A small optimization makes BufWriterImpl's writeU1/U2/Int/Long methods more
> C2-friendly and improves performance.
@wenshao
Your change (at version cd1140c1782255a5a1fcaaac89a37d21bf32582b) is now ready
to be sponsored by a Committer.
-
On Wed, 28 Aug 2024 13:16:03 GMT, Shaojin Wen wrote:
> A small optimization makes BufWriterImpl's writeU1/U2/Int/Long methods more
> C2-friendly and improves performance.
Ok, I did some adhoc testing to convince me that these are equivalent for these
cases. Masking in line with intended semant
On Wed, 28 Aug 2024 13:16:03 GMT, Shaojin Wen wrote:
> A small optimization makes BufWriterImpl's writeU1/U2/Int/Long methods more
> C2-friendly and improves performance.
The general way of writing should be like this:
elems[offset++] = (byte) (intValue >>> 8 * (intSize - i - 1));
```
* now
On Wed, 28 Aug 2024 18:38:40 GMT, Claes Redestad wrote:
>> A small optimization makes BufWriterImpl's writeU1/U2/Int/Long methods more
>> C2-friendly and improves performance.
>
> I made an off-list suggestion along this line some time before integration.
> IIRC it was a decent win back then, a
On Wed, 28 Aug 2024 13:16:03 GMT, Shaojin Wen wrote:
> A small optimization makes BufWriterImpl's writeU1/U2/Int/Long methods more
> C2-friendly and improves performance.
Needs to mask with `& 0xFF` in these places, otherwise you're changing
semantics.
-
Changes requested by rede
On Wed, 28 Aug 2024 13:16:03 GMT, Shaojin Wen wrote:
> A small optimization makes BufWriterImpl's writeU1/U2/Int/Long methods more
> C2-friendly and improves performance.
Marked as reviewed by liach (Reviewer).
-
PR Review: https://git.openjdk.org/jdk/pull/20748#pullrequestreview-
On Wed, 28 Aug 2024 13:16:03 GMT, Shaojin Wen wrote:
> A small optimization makes BufWriterImpl's writeU1/U2/Int/Long methods more
> C2-friendly and improves performance.
src/java.base/share/classes/jdk/internal/classfile/impl/BufWriterImpl.java line
124:
> 122: public void writeLong(long
On Wed, 28 Aug 2024 13:16:03 GMT, Shaojin Wen wrote:
> A small optimization makes BufWriterImpl's writeU1/U2/Int/Long methods more
> C2-friendly and improves performance.
I made an off-list suggestion along this line some time before integration.
IIRC it was a decent win back then, and with th
On Wed, 28 Aug 2024 13:16:03 GMT, Shaojin Wen wrote:
> A small optimization makes BufWriterImpl's writeU1/U2/Int/Long methods more
> C2-friendly and improves performance.
@liach
Is this what you want to see?
## baseline
@ 29 jdk.internal.classfile.impl.BufWriterImpl::writeU1 (8 bytes) in