Hi Igor,

On 08/01/2012 12:50 PM, Igor Rafael wrote:
Hi guys,

     I would like to change the inlining heuristics in IonMonkey, so that a 
function would be inlined the first time it is met in the program flow. To do 
this, I have commented out the code:

if (script->getUseCount()<  checkUses) {
     IonSpew(IonSpew_Inlining, "Not inlining, caller is not hot");
     return false;
}

The heuristic should be fine with the current mode of compilation which implies running JM first and IonMonkey second for the recompilation. Which means we are unlikely to hit this condition unless we hit an invalidation bailout which will reset the counter of the inlined script.

If you run with IonMonkey first (--no-jm), then this check is likely to fail because the use count is incremented at loop-head and at the function entry point. This means that we are likely to have a smaller use-count (off by 1) for the inlined functions which are only call once per loop iterations. It might be interesting to tweak this heuristic by expecting one less on the use-count counter of the inline function to balance the entry-point.

However IonMonkey is answering me "Cannot inline due to oracle veto". I have 
tried to follow the calls and this code seems to be related with the type inference 
algorithm. It seems that the type inference engine has not been executed at that point in 
time.
I would like to know what I could do to disable this veto. If it is not to 
abuse your patience, I would like to know also when this type inference engine 
runs and why it not runs before the first compilation.

You will need to run the TypeInferenceOracle which is just a wrapper on top of the Type Monitoring & Inference. Look at ion/TypeOrcale.cpp, the init function.

--
Nicolas B. Pierron
_______________________________________________
dev-tech-js-engine-internals mailing list
[email protected]
https://lists.mozilla.org/listinfo/dev-tech-js-engine-internals

Reply via email to