Re: RFR: 8337237: Use FFM instead of Unsafe for Java 2D RenderBuffer class [v3]

2024-08-14 Thread Jayathirth D V
On Mon, 29 Jul 2024 17:09:49 GMT, Phil Race wrote: >> Migrate from using Unsafe to FFM's MemorySegment API for allocating and >> setting native memory. >> This code is used by Metal, OpenGL and D3D, so I manually tested SwingSet2 >> and J2Demo as well as running all the usual tests. >> I also d

Re: RFR: 8337237: Use FFM instead of Unsafe for Java 2D RenderBuffer class [v2]

2024-07-30 Thread SWinxy
On Mon, 29 Jul 2024 17:05:21 GMT, Phil Race wrote: > Note that this code was written about a decade before that field was added to > JDK, so it I don't think you can criticise the author not using it. Wow. I did not realize that. Everything looks good. - PR Comment: https://git.op

Re: RFR: 8337237: Use FFM instead of Unsafe for Java 2D RenderBuffer class [v3]

2024-07-30 Thread Jorn Vernee
On Mon, 29 Jul 2024 17:09:49 GMT, Phil Race wrote: >> Migrate from using Unsafe to FFM's MemorySegment API for allocating and >> setting native memory. >> This code is used by Metal, OpenGL and D3D, so I manually tested SwingSet2 >> and J2Demo as well as running all the usual tests. >> I also d

Re: RFR: 8337237: Use FFM instead of Unsafe for Java 2D RenderBuffer class [v2]

2024-07-29 Thread Phil Race
On Fri, 26 Jul 2024 22:59:24 GMT, Phil Race wrote: >> Migrate from using Unsafe to FFM's MemorySegment API for allocating and >> setting native memory. >> This code is used by Metal, OpenGL and D3D, so I manually tested SwingSet2 >> and J2Demo as well as running all the usual tests. >> I also d

Re: RFR: 8337237: Use FFM instead of Unsafe for Java 2D RenderBuffer class [v3]

2024-07-29 Thread Phil Race
> Migrate from using Unsafe to FFM's MemorySegment API for allocating and > setting native memory. > This code is used by Metal, OpenGL and D3D, so I manually tested SwingSet2 > and J2Demo as well as running all the usual tests. > I also did some micro-benchmarking on the performance of Unsafe vs

Re: RFR: 8337237: Use FFM instead of Unsafe for Java 2D RenderBuffer class [v2]

2024-07-29 Thread SWinxy
On Fri, 26 Jul 2024 22:59:24 GMT, Phil Race wrote: >> Migrate from using Unsafe to FFM's MemorySegment API for allocating and >> setting native memory. >> This code is used by Metal, OpenGL and D3D, so I manually tested SwingSet2 >> and J2Demo as well as running all the usual tests. >> I also d

Re: RFR: 8337237: Use FFM instead of Unsafe for Java 2D RenderBuffer class [v2]

2024-07-26 Thread Phil Race
On Fri, 26 Jul 2024 08:39:47 GMT, Maurizio Cimadamore wrote: >> Phil Race has updated the pull request incrementally with one additional >> commit since the last revision: >> >> 8337237 > > src/java.desktop/share/classes/sun/java2d/pipe/RenderBuffer.java line 144: > >> 142: int

Re: RFR: 8337237: Use FFM instead of Unsafe for Java 2D RenderBuffer class [v2]

2024-07-26 Thread Phil Race
On Thu, 25 Jul 2024 23:57:35 GMT, Jorn Vernee wrote: >> src/java.desktop/share/classes/sun/java2d/pipe/RenderBuffer.java line 73: >> >>> 71: private final long baseAddress; >>> 72: private long curOffset; >>> 73: private final int capacity; >> >> You could perhaps drop the `capacity

Re: RFR: 8337237: Use FFM instead of Unsafe for Java 2D RenderBuffer class [v2]

2024-07-26 Thread Phil Race
On Thu, 25 Jul 2024 23:45:27 GMT, Jorn Vernee wrote: >> Phil Race has updated the pull request incrementally with one additional >> commit since the last revision: >> >> 8337237 > > src/java.desktop/share/classes/sun/java2d/pipe/RenderBuffer.java line 176: > >> 174: int lengthInB

Re: RFR: 8337237: Use FFM instead of Unsafe for Java 2D RenderBuffer class

2024-07-26 Thread Phil Race
On Fri, 26 Jul 2024 06:56:17 GMT, Per Minborg wrote: > Most put operations require that the item is properly aligned now that the > FFM API is used in conjunction with the aligned `ValueLayout` instances like > `JAVA_LONG`. `Unsafe` did not impose this restriction. Is this the intended > behav

Re: RFR: 8337237: Use FFM instead of Unsafe for Java 2D RenderBuffer class [v2]

2024-07-26 Thread Phil Race
On Fri, 26 Jul 2024 06:51:12 GMT, Per Minborg wrote: >> Phil Race has updated the pull request incrementally with one additional >> commit since the last revision: >> >> 8337237 > > src/java.desktop/share/classes/sun/java2d/pipe/RenderBuffer.java line 60: > >> 58: private static final in

Re: RFR: 8337237: Use FFM instead of Unsafe for Java 2D RenderBuffer class [v2]

2024-07-26 Thread Phil Race
> Migrate from using Unsafe to FFM's MemorySegment API for allocating and > setting native memory. > This code is used by Metal, OpenGL and D3D, so I manually tested SwingSet2 > and J2Demo as well as running all the usual tests. > I also did some micro-benchmarking on the performance of Unsafe vs

Re: RFR: 8337237: Use FFM instead of Unsafe for Java 2D RenderBuffer class

2024-07-26 Thread Maurizio Cimadamore
On Thu, 25 Jul 2024 22:53:36 GMT, Phil Race wrote: > Migrate from using Unsafe to FFM's MemorySegment API for allocating and > setting native memory. > This code is used by Metal, OpenGL and D3D, so I manually tested SwingSet2 > and J2Demo as well as running all the usual tests. > I also did so

Re: RFR: 8337237: Use FFM instead of Unsafe for Java 2D RenderBuffer class

2024-07-25 Thread Per Minborg
On Thu, 25 Jul 2024 22:53:36 GMT, Phil Race wrote: > Migrate from using Unsafe to FFM's MemorySegment API for allocating and > setting native memory. > This code is used by Metal, OpenGL and D3D, so I manually tested SwingSet2 > and J2Demo as well as running all the usual tests. > I also did so

Re: RFR: 8337237: Use FFM instead of Unsafe for Java 2D RenderBuffer class

2024-07-25 Thread Per Minborg
On Thu, 25 Jul 2024 22:53:36 GMT, Phil Race wrote: > Migrate from using Unsafe to FFM's MemorySegment API for allocating and > setting native memory. > This code is used by Metal, OpenGL and D3D, so I manually tested SwingSet2 > and J2Demo as well as running all the usual tests. > I also did so

Re: RFR: 8337237: Use FFM instead of Unsafe for Java 2D RenderBuffer class

2024-07-25 Thread Phil Race
On Thu, 25 Jul 2024 23:32:02 GMT, Jorn Vernee wrote: >> Migrate from using Unsafe to FFM's MemorySegment API for allocating and >> setting native memory. >> This code is used by Metal, OpenGL and D3D, so I manually tested SwingSet2 >> and J2Demo as well as running all the usual tests. >> I also

Re: RFR: 8337237: Use FFM instead of Unsafe for Java 2D RenderBuffer class

2024-07-25 Thread Jorn Vernee
On Thu, 25 Jul 2024 23:36:46 GMT, Jorn Vernee wrote: >> Migrate from using Unsafe to FFM's MemorySegment API for allocating and >> setting native memory. >> This code is used by Metal, OpenGL and D3D, so I manually tested SwingSet2 >> and J2Demo as well as running all the usual tests. >> I also

Re: RFR: 8337237: Use FFM instead of Unsafe for Java 2D RenderBuffer class

2024-07-25 Thread Jorn Vernee
On Thu, 25 Jul 2024 22:53:36 GMT, Phil Race wrote: > Migrate from using Unsafe to FFM's MemorySegment API for allocating and > setting native memory. > This code is used by Metal, OpenGL and D3D, so I manually tested SwingSet2 > and J2Demo as well as running all the usual tests. > I also did so

RFR: 8337237: Use FFM instead of Unsafe for Java 2D RenderBuffer class

2024-07-25 Thread Phil Race
Migrate from using Unsafe to FFM's MemorySegment API for allocating and setting native memory. This code is used by Metal, OpenGL and D3D, so I manually tested SwingSet2 and J2Demo as well as running all the usual tests. I also did some micro-benchmarking on the performance of Unsafe vs MemorySe