Mercurial > hg > graal-compiler
changeset 13835:67e4e7f56911
Truffle: add a simple API to report loop counts
author | Christian Wimmer <christian.wimmer@oracle.com> |
---|---|
date | Thu, 30 Jan 2014 17:52:24 -0800 |
parents | 4ca607fc94e0 |
children | 64c77f0577bb |
files | graal/com.oracle.truffle.api/src/com/oracle/truffle/api/nodes/RootNode.java |
diffstat | 1 files changed, 10 insertions(+), 0 deletions(-) [+] |
line wrap: on
line diff
--- a/graal/com.oracle.truffle.api/src/com/oracle/truffle/api/nodes/RootNode.java Fri Jan 31 00:32:03 2014 +0100 +++ b/graal/com.oracle.truffle.api/src/com/oracle/truffle/api/nodes/RootNode.java Thu Jan 30 17:52:24 2014 -0800 @@ -114,6 +114,16 @@ } /** + * Reports the execution count of a loop that is a child of this node. The optimization + * heuristics can use the loop count to guide compilation and inlining. + */ + public void reportLoopCount(int count) { + if (getCallTarget() instanceof LoopCountReceiver) { + ((LoopCountReceiver) getCallTarget()).reportLoopCount(count); + } + } + + /** * Executes this function using the specified frame and returns the result value. * * @param frame the frame of the currently executing guest language method