private void handleInlineFailTag()

in core/src/main/java/org/adoptopenjdk/jitwatch/report/suggestion/SuggestionWalker.java [346:418]


	private void handleInlineFailTag(Map<String, String> attrs, String methodID, IMetaMember caller, int currentBytecode,
			IParseDictionary parseDictionary)
	{
		IMetaMember callee = ParseUtil.lookupMember(methodID, parseDictionary, model);

		if (callee != null)
		{
			Tag methodTag = parseDictionary.getMethod(methodID);

			Map<String, String> methodTagAttributes = methodTag.getAttributes();

			String methodBytecodes = methodTagAttributes.get(ATTR_BYTES);
			String invocations = methodTagAttributes.get(ATTR_IICOUNT);

			if (invocations != null)
			{
				int invocationCount = Integer.parseInt(invocations);

				if (invocationCount >= MIN_INLINING_INVOCATIONS)
				{
					String reason = attrs.get(ATTR_REASON);
					reason = StringUtil.replaceXMLEntities(reason);

					double score = 0;

					if (scoreMap.containsKey(reason))
					{
						score = scoreMap.get(reason);
					}
					else
					{
						logger.warn("No score is set for reason: {}", reason);
					}

					StringBuilder reasonBuilder = new StringBuilder();

					reasonBuilder.append("The call at bytecode ").append(currentBytecode).append(" to\n");
					reasonBuilder.append("Class: ").append(callee.getMetaClass().getFullyQualifiedName()).append(C_NEWLINE);
					reasonBuilder.append("Member: ").append(callee.toStringUnqualifiedMethodName(false, false)).append(C_NEWLINE);
					reasonBuilder.append("was not inlined for reason: '").append(reason).append("'\n");

					if (explanationMap.containsKey(reason))
					{
						reasonBuilder.append(explanationMap.get(reason)).append(C_NEWLINE);
					}

					reasonBuilder.append("Invocations: ").append(invocationCount).append(C_NEWLINE);
					reasonBuilder.append("Size of callee bytecode: ").append(methodBytecodes);

					score *= invocationCount;

					if (score > 0)
					{
						Report suggestion = new Report(caller, compilationIndex, currentBytecode, reasonBuilder.toString(),
								ReportType.INLINE_FAILURE, (int) Math.ceil(score));

						if (!reportList.contains(suggestion))
						{
							reportList.add(suggestion);
						}
					}
				}
			}
			else if ("1".equals(methodTagAttributes.get(ATTR_UNLOADED)))
			{
			}
			else
			{
				logger.warn("Invocation count missing for methodID: {}", methodID);
				logger.warn("{}", methodTag);
			}
		}
	}