On Tue, 6 Sep 2022 09:14:47 GMT, Adam Sotona wrote:
>> LocalExecutionControl in jdk.jshell actually uses Thread::stop to cancel
>> execution of (long-running or infinite loops) user code in JShell, however
>> Thread::stop is deprecated and planned for removal.
>>
>> Proposed patch instruments
On Thu, 8 Sep 2022 08:34:59 GMT, Adam Sotona wrote:
> According to javadoc VarHandle of static field "effectively ignore the
> volatile declaration".
> Volatility of REPL.$Cancel.allStop field is critical for this use case.
VarHandles defines xxxVolatile so it would be feasible but I don't see
On Wed, 7 Sep 2022 19:48:56 GMT, ExE Boss wrote:
>> Adam Sotona has updated the pull request incrementally with one additional
>> commit since the last revision:
>>
>> Minor formating fixes
>
> src/jdk.jshell/share/classes/jdk/jshell/execution/LocalExecutionControl.java
> line 51:
>
>> 49:
On Tue, 6 Sep 2022 09:14:47 GMT, Adam Sotona wrote:
>> LocalExecutionControl in jdk.jshell actually uses Thread::stop to cancel
>> execution of (long-running or infinite loops) user code in JShell, however
>> Thread::stop is deprecated and planned for removal.
>>
>> Proposed patch instruments
On Wed, 7 Sep 2022 18:35:37 GMT, Jan Lahoda wrote:
> Not sure what you mean - as far as I can tell, neither the generated class,
> nor the snippets access `LocalExecutionControl.allStop`.
Okay, I see it now. REPL.$Cancel$.allStop is public so there is no issue
accessing it from LEC.invoke.
-
On Wed, 7 Sep 2022 18:22:21 GMT, Alan Bateman wrote:
> Would it be possible to summarize how the loader delegate work in jshell?
> Instrumenting the code to invoke REPL/$Cancel$.stopCheck looks reasonable but
> I can't immediately see how the generated REPL/$Cancel$ has access to
> LocalExecut
On Tue, 6 Sep 2022 09:14:47 GMT, Adam Sotona wrote:
>> LocalExecutionControl in jdk.jshell actually uses Thread::stop to cancel
>> execution of (long-running or infinite loops) user code in JShell, however
>> Thread::stop is deprecated and planned for removal.
>>
>> Proposed patch instruments
On Tue, 6 Sep 2022 09:14:47 GMT, Adam Sotona wrote:
>> LocalExecutionControl in jdk.jshell actually uses Thread::stop to cancel
>> execution of (long-running or infinite loops) user code in JShell, however
>> Thread::stop is deprecated and planned for removal.
>>
>> Proposed patch instruments
> LocalExecutionControl in jdk.jshell actually uses Thread::stop to cancel
> execution of (long-running or infinite loops) user code in JShell, however
> Thread::stop is deprecated and planned for removal.
>
> Proposed patch instruments all user code to call
> LocalExecutionControl::stopCheck m