Truffle deoptimization
Wei Zhang
wei.zhang at uci.edu
Wed Oct 9 23:31:44 PDT 2013
Hi all,
I had a problem when I try to figure out why one of my benchmark is
getting deoptimized after being compiled by Truffle.
I tried using -XX:+TraceDeoptimization, but it doesn't give me enough
info so I can track down what the problem was...
This is the small python program that I was testing:
https://bitbucket.org/ssllab/zippy/src/580d8e06b4045a10af0e8ea87618aa997d4d12e4/graal/edu.uci.python.benchmark/src/micro/arith_binop.py?at=default
I ran it with this command:
./mx.sh --vm server python
graal/edu.uci.python.benchmark/src/micro/arith_binop.py
@-XX:+TraceDeoptimization @-esa @-ea
The related printout from graal:
---------------------------------------------
[truffle] optimized <function docompute at 38eb0f4d>
|Nodes 39 |Time 4746(1299+3447)ms |Nodes 312/ 1073 |CodeSize
6023
Uncommon trap bci=2 pc=40238440, relative_pc=488, method=contains
Uncommon trap occurred in
com.oracle.graal.truffle.OptimizedCallTarget::executeHelper
(@0x000000010265fd68) thread=6403 reason=null_check action=reinterpret
unloaded_class_index=-1
Uncommon trap bci=57 pc=39641592, relative_pc=5848, method=callHelper
Uncommon trap occurred in edu.uci.python.nodes.PNode::executeDouble
(@0x00000001025ce1f8) thread=6403 reason=unloaded action=reinterpret
unloaded_class_index=-1
[truffle] invalidated <function docompute at 38eb0f4d>
|Alive 6ms |Inv# 1 |Replace#
33
---------------------------------------------
It says PNode.executeDouble, but there's no node rewrite after the invalidation.
Btw, what does "unloaded" mean as a reason?
I suspect it is caused by the function call in the loop body of my
testing program. But there's no
CompilerDirectives.transferToInterpreter() or Assumption invalidation
in my CallFunctionNode.
The source of the Node is:
https://bitbucket.org/ssllab/zippy/src/580d8e06b4045a10af0e8ea87618aa997d4d12e4/graal/edu.uci.python.nodes/src/edu/uci/python/nodes/calls/CallFunctionNode.java?at=default
After head scratching and trying random stuff for half a day, I though
I should ask about this here.
Any help is welcome, thanks!
/Wei
Zhang, Wei
UCI-EECS-CSS
More information about the graal-dev
mailing list