Index: working_vm/vm/jitrino/src/optimizer/inliner.cpp =================================================================== --- working_vm/vm/jitrino/src/optimizer/inliner.cpp (版本 682263) +++ working_vm/vm/jitrino/src/optimizer/inliner.cpp (工作副本) @@ -45,13 +45,15 @@ #define INLINE_LARGE_THRESHOLD 70 -#define MAX_INLINE_GROWTH_FACTOR_PROF 500 +#define MAX_INLINE_GROWTH_FACTOR_PROF 800 + #define MIN_INLINE_STOP_PROF 100 -// no negative profile benefit for nodes with freq >= 1/10 of entry freq #define MIN_BENEFIT_THRESHOLD_PROF (MIN_BENEFIT_THRESHOLD / 10) #define INLINE_LARGE_THRESHOLD_PROF 150 +#define INLINE_HOTNESS_BONUS 10 + #define CALL_COST 1 #define INLINE_SMALL_THRESHOLD 12 @@ -110,6 +112,8 @@ _inlineExactArgBonus = argSource->getIntArg("exact_single_parameter_bonus", INLINE_EXACT_ARG_BONUS); _inlineExactAllBonus = argSource->getIntArg("exact_all_parameter_bonus", INLINE_EXACT_ALL_BONUS); + _inlineHotnessBonus = argSource->getIntArg("hotness_bonus", INLINE_HOTNESS_BONUS); + _inlineMaxNodeThreshold = irm.getOptimizerFlags().hir_node_threshold * irm.getOptimizerFlags().inline_node_quota / 100; _inlineSkipExceptionPath = argSource->getBoolArg("skip_exception_path", INLINE_SKIP_EXCEPTION_PATH); @@ -285,13 +289,11 @@ double heatThreshold = _toplevelIRM.getHeatThreshold(); double nodeCount = node->getExecCount(); double scale = nodeCount / heatThreshold; - if(scale > 100) - scale = 100; // Remove any loop bonus as this is already accounted for in block count benefit -= _inlineLoopBonus*loopDepth; // Scale by call site 'hotness'. - benefit = (U_32) ((double) benefit * scale); + benefit = (U_32) (benefit + ((double)_inlineHotnessBonus * scale)); Log::out() << " HeatThreshold=" << heatThreshold << ", nodeCount=" << nodeCount << ", scale=" << scale @@ -928,6 +930,8 @@ methodByteSize = (methodByteSize <= CALL_COST) ? 1 : methodByteSize-CALL_COST; newByteSize = _currentByteSize + methodByteSize; double factor = ((double) newByteSize) / ((double) _initByteSize); + + if(newByteSize < _minInlineStop || factor <= _maxInlineGrowthFactor || (methodByteSize < _inlineSmallMaxByteSize)) { found = true; } else {