Re: RFR: 8287281: adjust guarantee in Handshake::execute for the case of target thread being current [v6]

2022-06-13 Thread Serguei Spitsyn
On Mon, 13 Jun 2022 11:42:43 GMT, David Holmes wrote: > Maybe we actually need to backtrack and restore an invariant that there is > always a TLH even for the current thread and fix the JVMTI code that did > things differently? This will make JVMTI code unnecessarily ugly in a couple of spots.

Re: RFR: 8287281: adjust guarantee in Handshake::execute for the case of target thread being current [v6]

2022-06-13 Thread David Holmes
On Mon, 13 Jun 2022 07:45:41 GMT, Robbin Ehn wrote: >> Johan Sjölén has updated the pull request incrementally with one additional >> commit since the last revision: >> >> Move assert up and remove other assert, remove unused var > > The only way to become an active handshaker is to handshake

Re: RFR: 8287281: adjust guarantee in Handshake::execute for the case of target thread being current [v6]

2022-06-13 Thread Robbin Ehn
On Tue, 7 Jun 2022 12:42:05 GMT, Johan Sjölén wrote: >> Please review this PR for fixing JDK-8287281. >> >> If a thread is handshake safe we immediately execute the closure, instead of >> going through the regular Handshake process. >> >> Finally: Should `VirtualThreadGetThreadClosure` and i

Re: RFR: 8287281: adjust guarantee in Handshake::execute for the case of target thread being current [v6]

2022-06-07 Thread David Holmes
On Tue, 7 Jun 2022 12:42:05 GMT, Johan Sjölén wrote: >> Please review this PR for fixing JDK-8287281. >> >> If a thread is handshake safe we immediately execute the closure, instead of >> going through the regular Handshake process. >> >> Finally: Should `VirtualThreadGetThreadClosure` and i

Re: RFR: 8287281: adjust guarantee in Handshake::execute for the case of target thread being current [v6]

2022-06-07 Thread Johan Sjölén
> Please review this PR for fixing JDK-8287281. > > If a thread is handshake safe we immediately execute the closure, instead of > going through the regular Handshake process. > > Finally: Should `VirtualThreadGetThreadClosure` and its `do_thread()` body > be inlined instead? We can do this i

Re: RFR: 8287281: adjust guarantee in Handshake::execute for the case of target thread being current [v4]

2022-06-07 Thread Johan Sjölén
On Mon, 6 Jun 2022 16:36:01 GMT, Daniel D. Daugherty wrote: >> We also no longer need L358 as `current` is now unused. > > JavaThread *target = state->get_thread(); > Thread *current = Thread::current(); > > assert(state != NULL, "sanity check"); > > The `assert()` on L360 is in the wrong p

Re: RFR: 8287281: adjust guarantee in Handshake::execute for the case of target thread being current [v5]

2022-06-07 Thread Johan Sjölén
On Tue, 7 Jun 2022 09:58:11 GMT, Johan Sjölén wrote: >> Please review this PR for fixing JDK-8287281. >> >> If a thread is handshake safe we immediately execute the closure, instead of >> going through the regular Handshake process. >> >> Finally: Should `VirtualThreadGetThreadClosure` and i

Re: RFR: 8287281: adjust guarantee in Handshake::execute for the case of target thread being current [v5]

2022-06-07 Thread Johan Sjölén
> Please review this PR for fixing JDK-8287281. > > If a thread is handshake safe we immediately execute the closure, instead of > going through the regular Handshake process. > > Finally: Should `VirtualThreadGetThreadClosure` and its `do_thread()` body > be inlined instead? We can do this i

Re: RFR: 8287281: adjust guarantee in Handshake::execute for the case of target thread being current [v4]

2022-06-07 Thread Johan Sjölén
On Mon, 6 Jun 2022 07:15:45 GMT, David Holmes wrote: >> Johan Sjölén has updated the pull request incrementally with three >> additional commits since the last revision: >> >> - do_thread(target) not self >> - Remove checks for is_handshake_for, instead call Handshake::execute >> - Switch or

Re: RFR: 8287281: adjust guarantee in Handshake::execute for the case of target thread being current [v4]

2022-06-06 Thread Daniel D . Daugherty
On Mon, 6 Jun 2022 07:20:10 GMT, David Holmes wrote: >> src/hotspot/share/prims/jvmtiEventController.cpp line 370: >> >>> 368: } >>> 369: EnterInterpOnlyModeClosure hs; >>> 370: assert(state->get_thread() != NULL, "sanity check"); >> >> Existing: We have already performed this check. We s

Re: RFR: 8287281: adjust guarantee in Handshake::execute for the case of target thread being current [v4]

2022-06-06 Thread Daniel D . Daugherty
On Mon, 6 Jun 2022 07:17:15 GMT, David Holmes wrote: >> Johan Sjölén has updated the pull request incrementally with three >> additional commits since the last revision: >> >> - do_thread(target) not self >> - Remove checks for is_handshake_for, instead call Handshake::execute >> - Switch or

Re: RFR: 8287281: adjust guarantee in Handshake::execute for the case of target thread being current [v4]

2022-06-06 Thread Daniel D . Daugherty
On Fri, 3 Jun 2022 09:45:31 GMT, Johan Sjölén wrote: >> Please review this PR for fixing JDK-8287281. >> >> If a thread is handshake safe we immediately execute the closure, instead of >> going through the regular Handshake process. >> >> Finally: Should `VirtualThreadGetThreadClosure` and i

Re: RFR: 8287281: adjust guarantee in Handshake::execute for the case of target thread being current [v4]

2022-06-06 Thread David Holmes
On Fri, 3 Jun 2022 09:45:31 GMT, Johan Sjölén wrote: >> Please review this PR for fixing JDK-8287281. >> >> If a thread is handshake safe we immediately execute the closure, instead of >> going through the regular Handshake process. >> >> Finally: Should `VirtualThreadGetThreadClosure` and i

Re: RFR: 8287281: adjust guarantee in Handshake::execute for the case of target thread being current [v4]

2022-06-06 Thread David Holmes
On Mon, 6 Jun 2022 07:19:06 GMT, David Holmes wrote: >> Johan Sjölén has updated the pull request incrementally with three >> additional commits since the last revision: >> >> - do_thread(target) not self >> - Remove checks for is_handshake_for, instead call Handshake::execute >> - Switch or

Re: RFR: 8287281: adjust guarantee in Handshake::execute for the case of target thread being current [v4]

2022-06-05 Thread Johan Sjölén
On Fri, 3 Jun 2022 09:45:31 GMT, Johan Sjölén wrote: >> Please review this PR for fixing JDK-8287281. >> >> If a thread is handshake safe we immediately execute the closure, instead of >> going through the regular Handshake process. >> >> Finally: Should `VirtualThreadGetThreadClosure` and i

Re: RFR: 8287281: adjust guarantee in Handshake::execute for the case of target thread being current [v4]

2022-06-03 Thread Patricio Chilano Mateo
On Fri, 3 Jun 2022 09:45:31 GMT, Johan Sjölén wrote: >> Please review this PR for fixing JDK-8287281. >> >> If a thread is handshake safe we immediately execute the closure, instead of >> going through the regular Handshake process. >> >> Finally: Should `VirtualThreadGetThreadClosure` and i

Re: RFR: 8287281: adjust guarantee in Handshake::execute for the case of target thread being current [v4]

2022-06-03 Thread Robbin Ehn
On Fri, 3 Jun 2022 09:45:31 GMT, Johan Sjölén wrote: >> Please review this PR for fixing JDK-8287281. >> >> I chose a different solution than the one suggested. Looking at all callers >> of `Handshake::execute`, it seems that only one depends on `target == >> current`. The rest special case th

Re: RFR: 8287281: adjust guarantee in Handshake::execute for the case of target thread being current [v4]

2022-06-03 Thread Johan Sjölén
> Please review this PR for fixing JDK-8287281. > > I chose a different solution than the one suggested. Looking at all callers > of `Handshake::execute`, it seems that only one depends on `target == > current`. The rest special case that by calling `is_handshake_safe_for` and > `do_thread` dir

Re: RFR: 8287281: adjust guarantee in Handshake::execute for the case of target thread being current [v3]

2022-06-03 Thread Johan Sjölén
> Please review this PR for fixing JDK-8287281. > > I chose a different solution than the one suggested. Looking at all callers > of `Handshake::execute`, it seems that only one depends on `target == > current`. The rest special case that by calling `is_handshake_safe_for` and > `do_thread` dir

Re: RFR: 8287281: adjust guarantee in Handshake::execute for the case of target thread being current

2022-06-03 Thread Johan Sjölén
On Thu, 2 Jun 2022 13:47:23 GMT, Johan Sjölén wrote: > Please review this PR for fixing JDK-8287281. > > I chose a different solution than the one suggested. Looking at all callers > of `Handshake::execute`, it seems that only one depends on `target == > current`. The rest special case that by

Re: RFR: 8287281: adjust guarantee in Handshake::execute for the case of target thread being current [v2]

2022-06-03 Thread Johan Sjölén
> Please review this PR for fixing JDK-8287281. > > I chose a different solution than the one suggested. Looking at all callers > of `Handshake::execute`, it seems that only one depends on `target == > current`. The rest special case that by calling `is_handshake_safe_for` and > `do_thread` dir

RFR: 8287281: adjust guarantee in Handshake::execute for the case of target thread being current

2022-06-02 Thread Johan Sjölén
Please review this PR for fixing JDK-8287281. I chose a different solution than the one suggested. Looking at all callers of `Handshake::execute`, it seems that only one depends on `target == current`. The rest special case that by calling `is_handshake_safe_for` and `do_thread` directly. I co

Re: RFR: 8287281: adjust guarantee in Handshake::execute for the case of target thread being current

2022-06-02 Thread Robbin Ehn
On Thu, 2 Jun 2022 13:47:23 GMT, Johan Sjölén wrote: > Please review this PR for fixing JDK-8287281. > > I chose a different solution than the one suggested. Looking at all callers > of `Handshake::execute`, it seems that only one depends on `target == > current`. The rest special case that by