Skip to content

Commit

Permalink
Fixes issues #270 and #271
Browse files Browse the repository at this point in the history
  • Loading branch information
chriswhocodes committed Oct 18, 2017
1 parent a1a07c9 commit f7c372b
Show file tree
Hide file tree
Showing 17 changed files with 30 additions and 1,413 deletions.
@@ -1,5 +1,5 @@
/* /*
* Copyright (c) 2013-2016 Chris Newland. * Copyright (c) 2013-2017 Chris Newland.
* Licensed under https://github.com/AdoptOpenJDK/jitwatch/blob/master/LICENSE-BSD * Licensed under https://github.com/AdoptOpenJDK/jitwatch/blob/master/LICENSE-BSD
* Instructions: https://github.com/AdoptOpenJDK/jitwatch/wiki * Instructions: https://github.com/AdoptOpenJDK/jitwatch/wiki
*/ */
Expand Down Expand Up @@ -74,11 +74,6 @@ public int compare(Map.Entry<InstructionSequence, Integer> o1, Map.Entry<Instruc
return result; return result;
} }


public int getCountForChain(String chain)
{
return chainCountMap.get(chain);
}

public void reset() public void reset()
{ {
chain.clear(); chain.clear();
Expand Down
@@ -1,13 +1,12 @@
/* /*
* Copyright (c) 2013-2016 Chris Newland. * Copyright (c) 2013-2017 Chris Newland.
* Licensed under https://github.com/AdoptOpenJDK/jitwatch/blob/master/LICENSE-BSD * Licensed under https://github.com/AdoptOpenJDK/jitwatch/blob/master/LICENSE-BSD
* Instructions: https://github.com/AdoptOpenJDK/jitwatch/wiki * Instructions: https://github.com/AdoptOpenJDK/jitwatch/wiki
*/ */
package org.adoptopenjdk.jitwatch.model.assembly; package org.adoptopenjdk.jitwatch.model.assembly;


import static org.adoptopenjdk.jitwatch.core.JITWatchConstants.C_COLON; import static org.adoptopenjdk.jitwatch.core.JITWatchConstants.C_COLON;
import static org.adoptopenjdk.jitwatch.core.JITWatchConstants.C_SPACE; import static org.adoptopenjdk.jitwatch.core.JITWatchConstants.C_SPACE;
import static org.adoptopenjdk.jitwatch.core.JITWatchConstants.DEBUG_LOGGING_ASSEMBLY;
import static org.adoptopenjdk.jitwatch.core.JITWatchConstants.S_HEX_PREFIX; import static org.adoptopenjdk.jitwatch.core.JITWatchConstants.S_HEX_PREFIX;
import static org.adoptopenjdk.jitwatch.core.JITWatchConstants.S_COMMA; import static org.adoptopenjdk.jitwatch.core.JITWatchConstants.S_COMMA;
import static org.adoptopenjdk.jitwatch.core.JITWatchConstants.S_DOUBLE_SPACE; import static org.adoptopenjdk.jitwatch.core.JITWatchConstants.S_DOUBLE_SPACE;
Expand All @@ -18,13 +17,8 @@


import java.util.ArrayList; import java.util.ArrayList;
import java.util.List; import java.util.List;
import java.util.regex.Matcher;
import java.util.regex.Pattern;


import org.adoptopenjdk.jitwatch.optimizedvcall.VirtualCallSite;
import org.adoptopenjdk.jitwatch.util.StringUtil; import org.adoptopenjdk.jitwatch.util.StringUtil;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;


public class AssemblyInstruction public class AssemblyInstruction
{ {
Expand All @@ -37,10 +31,6 @@ public class AssemblyInstruction
private final AssemblyLabels labels; private final AssemblyLabels labels;
private boolean isSafePoint = false; private boolean isSafePoint = false;


private static final Pattern PATTERN_ASSEMBLY_CALL_SIG = Pattern.compile("^; - (.*)::(.*)@(.*)\\s\\(line\\s(.*)\\)");

private static final Logger logger = LoggerFactory.getLogger(AssemblyInstruction.class);

public AssemblyInstruction(String annotation, long address, List<String> prefixes, String mnemonic, List<String> operands, public AssemblyInstruction(String annotation, long address, List<String> prefixes, String mnemonic, List<String> operands,
String firstComment, AssemblyLabels labels) String firstComment, AssemblyLabels labels)
{ {
Expand Down Expand Up @@ -150,46 +140,6 @@ public boolean isOptimizedVCall()
return result; return result;
} }


public VirtualCallSite getOptimizedVirtualCallSiteOrNull()
{
VirtualCallSite result = null;

if (isOptimizedVCall())
{
// Oop comment
// *invoke comment
// callsite comment+
// optimized virtual_call

String callSiteCommentLine = commentLines.get(2);

Matcher matcher = PATTERN_ASSEMBLY_CALL_SIG.matcher(callSiteCommentLine);

if (matcher.find())
{
String className = matcher.group(1);
String methodName = matcher.group(2);
String bytecodeOffset = matcher.group(3);
String lineNumber = matcher.group(4);

try
{
result = new VirtualCallSite(className, methodName, Integer.parseInt(bytecodeOffset),
Integer.parseInt(lineNumber));
}
catch (NumberFormatException nfe)
{
if (DEBUG_LOGGING_ASSEMBLY)
{
logger.warn("Could not parse CallSite from line: {}", callSiteCommentLine);
}
}
}
}

return result;
}

@Override @Override
public String toString() public String toString()
{ {
Expand Down

This file was deleted.

0 comments on commit f7c372b

Please sign in to comment.