Again Trouble with Non-local Returns

Stefan Marr java at stefan-marr.de
Wed May 7 22:35:39 UTC 2014


Hi Gilles:

On 08 May 2014, at 00:21, Gilles Duboscq <duboscq at ssw.jku.at> wrote:

> action=none indicates that the code is not invalidated.
> Thus there is no chance to produce better code. This can be because a transferToInterpreter is used where a transferToInterpreterAndInvalidate was intended.

Thanks, but that doesn’t seem to be it.
I tried to replace all transferToInterpreter with transfer and invalidate, but to no avail.
And, I also checked, the only case where I have them is in [Non]LocalVariableWriteNode, where they are used exactly like in JRuby and ZipPy.

One thing that might be interesting, I think, the method that is relevant here has a SequenceNode, with an uninitialized node at the end. Specifically, #nlr has a node to read `self`, and return it at the end, but because of the non-local return, that’s never executed and never initialized.
Might that confuse the system?

Best regards
Stefan

> On 7 May 2014 23:26, "Stefan Marr" <java at stefan-marr.de> wrote:
> Dear all:
> 
> I think, I might have identified one of the potential issues holding back TruffleSOM.
> 
> A lucky guess let me to look into the performance of non-local returns once more.
> 
> The key part of the micro benchmark looks like this:
> 
>     first:  a = ( ^ self second: a )
>     second: a = ( ^ self third: a  )
>     third:  a = ( a value )
> 
>     nlr = (
>         self first: [^ 1]
>     )
> 
> Meaning, the #nlr method catches the non-local return of the value 1 and returns to the caller.
> 
> The main problem I am seeing is that one of the involved call targets is triggering uncommon traps again.
> Think, we had a similar issue a while back, but I didn’t notice any regressions around non-local returns, so, I presume its a slightly different case this time.
> 
> The uncommon trap looks like this:
> 
> Uncommon trap occurred in com.oracle.graal.truffle.OptimizedCallTarget::callRoot (Graal: installed code has no name)  (@0x0000000110318b2c) thread=6403 reason=null_assert|unreached0 action=none unloaded_class_index=-1 debug_id=0
> Uncommon trap   bci=0 pc=271682348, relative_pc=268, method=com.oracle.graal.truffle.OptimizedCallTarget.callRoot([Ljava/lang/Object;)Ljava/lang/Object;, debug_id=0
> No speculation
> 
> 
> To reproduce you can execute the following:
> 
> git clone --recursive https://github.com/SOM-st/TruffleSOM.git
> cd TruffleSOM
> ant
> mx --vm server vm -XX:+UnlockDiagnosticVMOptions -XX:+TraceDeoptimization -Xbootclasspath/a:build/classes:libs/truffle.jar som.vm.Universe -cp Smalltalk Examples/Benchmarks/BenchmarkHarness.som NonLocalReturn 20 0 1000
> 
> 
> Any thoughts on the issue, could it be something in Graal?
> 
> Thanks
> Stefan
> 
> --
> Stefan Marr
> INRIA Lille - Nord Europe
> http://stefan-marr.de/research/
> 
> 
> 

-- 
Stefan Marr
INRIA Lille - Nord Europe
http://stefan-marr.de/research/





More information about the graal-dev mailing list