Dataset Viewer
Auto-converted to Parquet Duplicate
proj_name
stringclasses
70 values
relative_path
stringlengths
37
333
class_name
stringlengths
1
78
func_name
stringlengths
1
94
func_body
stringlengths
0
7.93k
masked_class
stringlengths
47
8.74k
len_input
int64
24
2.03k
len_output
int64
1
2k
total
int64
26
2.05k
finetune_output
stringlengths
0
11.8k
compile_info
stringclasses
1 value
inherit_elements
stringlengths
0
220k
AdoptOpenJDK_jitwatch
jitwatch/core/src/main/java/org/adoptopenjdk/jitwatch/chain/CompileChainWalker.java
CompileChainWalker
processParseTag
String methodID = null; CompileNode lastNode = null; Map<String, String> methodAttrs = new HashMap<>(); Map<String, String> callAttrs = new HashMap<>(); for (Tag child : parseTag.getChildren()) { String tagName = child.getName(); Map<String, String> tagAttrs = child.getAttributes(); switch (tag...
class CompileChainWalker extends AbstractCompilationVisitable { private static final Logger logger = LoggerFactory.getLogger(CompileChainWalker.class); private IReadOnlyJITDataModel model; private CompileNode root = null; private Compilation compilation; public CompileChainWalker(IReadOnlyJITDataModel model) ...
792
739
1,531
String methodID = parseTag.getAttributes().get(ATTR_METHOD); String callerID = parseTag.getAttributes().get(ATTR_CALLER); boolean inlined = parseTag.getAttributes().get(ATTR_INLINED).equals("true"); boolean virtualCall = parseTag.getAttributes().get(ATTR_VIRTUAL_CALL).equals("true"); Map<String, String> met...
<COMPILED_SUCCESSFULLY>
Set<String> ignoreTags=newHashSet<>();void handleOther( Tag tag){}
AdoptOpenJDK_jitwatch
jitwatch/core/src/main/java/org/adoptopenjdk/jitwatch/chain/CompileNode.java
CompileNode
setInlined
this.inlined = inlined;
class CompileNode { private boolean inlined = false; private boolean virtualCall = false; private String tooltip; private List<CompileNode> children; private CompileNode parent = null; private String methodID = null; private IParseDictionary parseDictionary; private IReadOnlyJITDataModel model; ...
1,000
13
1,013
this.inlined = inlined;
<COMPILED_SUCCESSFULLY>
AdoptOpenJDK_jitwatch
jitwatch/core/src/main/java/org/adoptopenjdk/jitwatch/compilation/AbstractCompilationWalker.java
AbstractCompilationWalker
walkCompilations
TreeVisitor.walkTree(model, this);
class AbstractCompilationWalker extends AbstractCompilationVisitable implements ITreeVisitable { protected IReadOnlyJITDataModel model; public AbstractCompilationWalker(IReadOnlyJITDataModel model) { this.model = model; } public void walkCompilations() {<FILL_FUNCTION_BODY>} @Override public void visitT...
116
17
133
walk(model.getCompilations());
<COMPILED_SUCCESSFULLY>
Set<String> ignoreTags=newHashSet<>();void handleOther( Tag tag){}
AdoptOpenJDK_jitwatch
jitwatch/core/src/main/java/org/adoptopenjdk/jitwatch/compilation/codecache/CodeCacheEventWalker.java
CodeCacheEventWalker
visit
if (metaMember != null && metaMember.isCompiled()) { for (Compilation compilation : metaMember.getCompilations()) { if (compilation.isFailed()) { continue; } String address = compilation.getNativeAddress(); // hex string if (address != null) { long addressLong = 0; l...
class CodeCacheEventWalker extends AbstractCompilationWalker { private CodeCacheWalkerResult result = new CodeCacheWalkerResult(); private static final Logger logger = LoggerFactory.getLogger(CodeCacheEventWalker.class); public CodeCacheEventWalker(IReadOnlyJITDataModel model) { super(model); } @Override pu...
155
343
498
result.add(metaMember);
<COMPILED_SUCCESSFULLY>
IReadOnlyJITDataModel model;void walkCompilations(){};void visitTag( Tag toVisit, IParseDictionary parseDictionary) throws LogParseException {};Set<String> ignoreTags=newHashSet<>();void handleOther( Tag tag){}
AdoptOpenJDK_jitwatch
jitwatch/core/src/main/java/org/adoptopenjdk/jitwatch/core/ErrorLog.java
ErrorLog
addEntry
if (errorCountMap.containsKey(entry)) { errorCountMap.put(entry, errorCountMap.get(entry) + 1); } else { errorCountMap.put(entry, 1); }
class ErrorLog { private Map<String, Integer> errorCountMap = new LinkedHashMap<>(); public void clear() { errorCountMap.clear(); } public void addEntry(String entry) {<FILL_FUNCTION_BODY>} @Override public String toString() { StringBuilder builder = new StringBuilder(); for (Map.Entry<String, Intege...
256
67
323
Integer count = errorCountMap.get(entry); if (count == null) { errorCountMap.put(entry, 1); } else { errorCountMap.put(entry, count + 1); }
<COMPILED_SUCCESSFULLY>
AdoptOpenJDK_jitwatch
jitwatch/core/src/main/java/org/adoptopenjdk/jitwatch/core/TagProcessor.java
TagProcessor
processValidLine
if (DEBUG_LOGGING_TAGPROCESSOR) { logger.debug("processValidLine(line:{}, indexEndName:{}, selfClosing:{})", line, indexEndName, selfClosing); } Tag result = null; String name = line.substring(1, indexEndName); String attributeString = line.substring(indexEndName); Map<String, String> attrs = Stri...
class TagProcessor { private static final Logger logger = LoggerFactory.getLogger(TagProcessor.class); private Stack<String> methodIDStack = new Stack<>(); private Tag currentTag; private Tag topTag = null; private boolean fragmentSeen; public String getTopTagName() { String result = null; if (topTag !=...
1,017
1,008
2,025
Tag result = null; String tagName = line.substring(1, indexEndName); if (DEBUG_LOGGING_TAGPROCESSOR) { logger.debug("tagName:{}", tagName); } if (S_FRAGMENT.equals(tagName)) { fragmentSeen = true; } if (currentTag == null) { result = new Tag(tagName); currentTag = result; topTag ...
<COMPILED_SUCCESSFULLY>
AdoptOpenJDK_jitwatch
jitwatch/core/src/main/java/org/adoptopenjdk/jitwatch/histo/AbstractHistoVisitable.java
AbstractHistoVisitable
buildHistogram
histo = new Histo(resolution); TreeVisitor.walkTree(model, this); return histo;
class AbstractHistoVisitable extends AbstractCompilationVisitable implements IHistoVisitable { protected Histo histo; protected IReadOnlyJITDataModel model; protected long resolution; public AbstractHistoVisitable(IReadOnlyJITDataModel model, long resolution) { this.model = model; this.resolution = resolution...
158
37
195
return histo;
<COMPILED_SUCCESSFULLY>
Set<String> ignoreTags=newHashSet<>();void handleOther( Tag tag){}
AdoptOpenJDK_jitwatch
jitwatch/core/src/main/java/org/adoptopenjdk/jitwatch/hotthrow/HotThrowFinder.java
HotThrowFinder
visitTag
String currentMethod = null; String holder = null; String currentBCI = null; Map<String, String> attrs = parseTag.getAttributes(); String methodID = attrs.get(ATTR_METHOD); Tag methodTag = parseDictionary.getMethod(methodID); Map<String, String> methodTagAttributes = methodTag.getAttributes(); cur...
class HotThrowFinder extends AbstractCompilationVisitable { private Set<HotThrowResult> result; private IReadOnlyJITDataModel model; private static final Logger logger = LoggerFactory.getLogger(HotThrowFinder.class); public HotThrowFinder(IReadOnlyJITDataModel model) { this.model = model; ignoreTags.add(TAG...
497
938
1,435
if (parseTag.getTag() == TAG_THROW) { result.add(new HotThrowResult(parseTag, parseDictionary, model)); }
<COMPILED_SUCCESSFULLY>
Set<String> ignoreTags=newHashSet<>();void handleOther( Tag tag){}
AdoptOpenJDK_jitwatch
jitwatch/core/src/main/java/org/adoptopenjdk/jitwatch/jarscan/allocationcount/AllocCountMap.java
AllocCountMap
countAllocationOfType
Integer count = typeCountMap.get(type); if (count == null) { count = 1; } else { count++; } typeCountMap.put(type, count);
class AllocCountMap { private Map<String, Integer> typeCountMap = new TreeMap<>(); public void countAllocationOfType(String type) {<FILL_FUNCTION_BODY>} public String toString(Opcode prefix, int limitPerInvoke) { StringBuilder builder = new StringBuilder(); List<Map.Entry<String, Integer>> sortedList = ...
413
70
483
Integer count = typeCountMap.get(type); if (count == null) { count = 0; } count++; typeCountMap.put(type, count);
<COMPILED_SUCCESSFULLY>
AdoptOpenJDK_jitwatch
jitwatch/core/src/main/java/org/adoptopenjdk/jitwatch/jarscan/invokecount/InvokeMethodCountMap.java
InvokeMethodCountMap
countInvocationOfMethod
MethodCountMap invokeCountMap = opcodeMap.get(opcode); if (invokeCountMap == null) { invokeCountMap = new MethodCountMap(); opcodeMap.put(opcode, invokeCountMap); } invokeCountMap.count(method);
class InvokeMethodCountMap { private Map<Opcode, MethodCountMap> opcodeMap = new EnumMap<>(Opcode.class); public void countInvocationOfMethod(Opcode opcode, String method) {<FILL_FUNCTION_BODY>} public String toString(int limitPerInvoke) { StringBuilder builder = new StringBuilder(); for (Map.Entry<Opcode, ...
185
79
264
MethodCountMap invokeCountMap = opcodeMap.get(opcode); if (invokeCountMap == null) { invokeCountMap = new MethodCountMap(); opcodeMap.put(opcode, invokeCountMap); } invokeCountMap.countInvocationOfMethod(method);
<COMPILED_SUCCESSFULLY>
AdoptOpenJDK_jitwatch
jitwatch/core/src/main/java/org/adoptopenjdk/jitwatch/jarscan/invokecount/MethodCountMap.java
MethodCountMap
toString
StringBuilder builder = new StringBuilder(); List<Map.Entry<String, Integer>> sortedList = new ArrayList<>(methodCountMap.entrySet()); Collections.sort(sortedList, new Comparator<Map.Entry<String, Integer>>() { @Override public int compare(Map.Entry<String, Integer> o1, Map.Entry<String, Integer> o2)...
class MethodCountMap { private Map<String, Integer> methodCountMap = new TreeMap<>(); public void count(String method) { Integer count = methodCountMap.get(method); if (count == null) { count = 1; } else { count++; } methodCountMap.put(method, count); } public String toString(Opcode...
139
338
477
StringBuilder sb = new StringBuilder(); for (Map.Entry<String, Integer> entry : methodCountMap.entrySet()) { String method = entry.getKey(); int count = entry.getValue(); if (count > limitPerInvoke) { sb.append(prefix).append(method).append(": ").append(count).append("\n"); } } r...
<COMPILED_SUCCESSFULLY>
AdoptOpenJDK_jitwatch
jitwatch/core/src/main/java/org/adoptopenjdk/jitwatch/jarscan/methodlength/MethodLengthOperation.java
MethodLengthOperation
processInstructions
List<BytecodeInstruction> instructions = memberBytecode.getInstructions(); if (instructions != null && instructions.size() > 0) { BytecodeInstruction lastInstruction = instructions.get(instructions.size() - 1); // final instruction is a return for 1 byte int bcSize = 1 + lastInstruction.getOffset(); ...
class MethodLengthOperation implements IJarScanOperation { private int findSize; private Map<MemberSignatureParts, Integer> methodMap = new HashMap<>(); public MethodLengthOperation(int findSize) { this.findSize = findSize; } @Override public String getReport() { List<Map.Entry<MemberSignatureParts, Inte...
686
171
857
List<MemberSignatureParts> mspList = memberBytecode.getMemberSignatureParts(); for (MemberSignatureParts msp : mspList) { int bytecodeSize = memberBytecode.getBytecodeSize(); if (bytecodeSize > findSize) { methodMap.put(msp, bytecodeSize); } }
<COMPILED_SUCCESSFULLY>
AdoptOpenJDK_jitwatch
jitwatch/core/src/main/java/org/adoptopenjdk/jitwatch/jarscan/nextinstruction/NextInstructionOperation.java
NextInstructionOperation
getReport
if (nextBytecodeMap == null) { calculate(); } StringBuilder builder = new StringBuilder(); List<Map.Entry<Opcode, NextInstructionCountList>> sortedList = new ArrayList<>(nextBytecodeMap.entrySet()); Collections.sort(sortedList, new Comparator<Map.Entry<Opcode, NextInstructionCountList>>() { @O...
class NextInstructionOperation extends SequenceCountOperation { private Map<Opcode, NextInstructionCountList> nextBytecodeMap; private int maxChildren = 0; public NextInstructionOperation(int maxChildren) { super(2); this.maxChildren = maxChildren; } private void calculate() { nextBytecodeMap = new Enu...
368
386
754
StringBuilder sb = new StringBuilder(); Map<Opcode, NextInstructionCountList> nextBytecodeMap = getNextBytecodeMap(); for (Map.Entry<Opcode, NextInstructionCountList> entry : nextBytecodeMap.entrySet()) { Opcode root = entry.getKey(); NextInstructionCountList nextBytecodeList = entry.getValue(); sb...
<COMPILED_SUCCESSFULLY>
Map<InstructionSequence,Integer> chainCountMap=newTreeMap<>();List<Opcode> chain=newLinkedList<>();int maxLength=0;void storeChain(){};Map<InstructionSequence,Integer> getSequenceScores(){};List<Map.Entry<InstructionSequence,Integer>> getSortedData(){};int compare( Map.Entry<InstructionSequence,Integer> o1, M...
AdoptOpenJDK_jitwatch
jitwatch/core/src/main/java/org/adoptopenjdk/jitwatch/jarscan/sequencecount/InstructionSequence.java
InstructionSequence
equals
return toString().equals(obj.toString());
class InstructionSequence implements Comparable<InstructionSequence> { private List<Opcode> sequence = new ArrayList<>(); public InstructionSequence(List<Opcode> opcodeList) { sequence.addAll(opcodeList); } @Override public String toString() { StringBuilder builder = new StringBuilder(); for (Opcode opc...
265
15
280
if (obj instanceof InstructionSequence) { return toString().equals(obj.toString()); } return false;
<COMPILED_SUCCESSFULLY>
AdoptOpenJDK_jitwatch
jitwatch/core/src/main/java/org/adoptopenjdk/jitwatch/jarscan/sequencecount/SequenceCountOperation.java
SequenceCountOperation
getSortedData
List<Map.Entry<InstructionSequence, Integer>> result = new ArrayList<>(chainCountMap.entrySet()); Collections.sort(result, new Comparator<Map.Entry<InstructionSequence, Integer>>() { @Override public int compare(Map.Entry<InstructionSequence, Integer> o1, Map.Entry<InstructionSequence, Integer> o2) { ...
class SequenceCountOperation implements IJarScanOperation { protected Map<InstructionSequence, Integer> chainCountMap = new TreeMap<>(); private List<Opcode> chain = new LinkedList<>(); private int maxLength = 0; public SequenceCountOperation(int maxLength) { this.maxLength = maxLength; } private void stor...
1,186
127
1,313
List<Map.Entry<InstructionSequence, Integer>> sortedData = new ArrayList<>(chainCountMap.entrySet()); Collections.sort(sortedData, new Comparator<Map.Entry<InstructionSequence, Integer>>() { @Override public int compare(Map.Entry<InstructionSequence, Integer> o1, Map.Entry<InstructionSequence, Integer> o2...
<COMPILED_SUCCESSFULLY>
AdoptOpenJDK_jitwatch
jitwatch/core/src/main/java/org/adoptopenjdk/jitwatch/jarscan/sequencesearch/FoundSequence.java
FoundSequence
equals
if (this == obj) { return true; } if (obj == null) { return false; } if (getClass() != obj.getClass()) { return false; } FoundSequence other = (FoundSequence) obj; if (msp == null) { if (other.msp != null) { return false; } } else if (!msp.equals(other.msp)) ...
class FoundSequence { private int startingBCI; private MemberSignatureParts msp; public FoundSequence(int startingBCI, MemberSignatureParts msp) { this.startingBCI = startingBCI; this.msp = msp; } public int getStartingBCI() { return startingBCI; } public MemberSignatureParts getMemberSignatureParts(...
248
186
434
if (this == obj) return true; if (obj == null) return false; if (getClass() != obj.getClass()) return false; FoundSequence other = (FoundSequence) obj; if (msp == null) { if (other.msp != null) return false; } else if (!msp.equals(other.msp)) return false; if (startingBCI != other....
<COMPILED_SUCCESSFULLY>
AdoptOpenJDK_jitwatch
jitwatch/core/src/main/java/org/adoptopenjdk/jitwatch/jarscan/sequencesearch/SequenceSearchOperation.java
SequenceSearchOperation
handleChainStartingAtIndex
boolean stopChain = false; boolean abandonChain = false; boolean matched = false; Set<Integer> visitedBCI = new HashSet<>(); while (chain.size() < wantedChain.size()) { BytecodeInstruction instruction = instructions.get(index); int instrBCI = instruction.getOffset(); visitedBCI.add(instrBCI);...
class SequenceSearchOperation implements IJarScanOperation { private List<FoundSequence> matchingMethods = new ArrayList<>(); private List<Opcode> chain = new LinkedList<>(); private List<Opcode> wantedChain = new LinkedList<>(); public SequenceSearchOperation(String sequence) { String[] searchSequence = sequ...
846
611
1,457
boolean matched = false; BytecodeInstruction instruction = instructions.get(index); Opcode opcode = instruction.getOpcode(); chain.add(opcode); if (compareChains()) { matched = true; } else { chain.remove(0); } return matched;
<COMPILED_SUCCESSFULLY>
AdoptOpenJDK_jitwatch
jitwatch/core/src/main/java/org/adoptopenjdk/jitwatch/jvmlang/LanguageManager.java
LanguageManager
getLanguageFromFile
String result = null; String fileExtension = getFileExtension(sourceFile); if (fileExtension != null) { fileExtension = fileExtension.toLowerCase(); switch (fileExtension) { case "java": result = VM_LANGUAGE_JAVA; break; case "scala": result = VM_LANGUAGE_SCALA; break; case...
class LanguageManager { private JITWatchConfig config; private ILogListener logListener; public LanguageManager(JITWatchConfig config, ILogListener logListener) { this.config = config; this.logListener = logListener; } public ICompiler getCompiler(String vmLanguage, String languageHomeDir) { ICompiler re...
1,240
280
1,520
String result = null; if (sourceFile != null) { String filename = sourceFile.getName(); int lastDotPos = filename.lastIndexOf(C_DOT); if (lastDotPos != -1) { String fileExtension = filename.substring(lastDotPos + 1); switch (fileExtension) { case "java": result = VM_LANGUAGE_...
<COMPILED_SUCCESSFULLY>
AdoptOpenJDK_jitwatch
jitwatch/core/src/main/java/org/adoptopenjdk/jitwatch/loader/DisposableURLClassLoader.java
DisposableURLClassLoader
getURLListCopy
return Collections.unmodifiableList(urlList);
class DisposableURLClassLoader extends URLClassLoader { private List<URL> urlList = new ArrayList<>(); public DisposableURLClassLoader(final List<URL> urls) { super(urls.toArray(new URL[urls.size()])); urlList.addAll(urls); } public List<URL> getURLListCopy() {<FILL_FUNCTION_BODY>} }
114
17
131
return new ArrayList<>(urlList);
<COMPILED_SUCCESSFULLY>
AdoptOpenJDK_jitwatch
jitwatch/core/src/main/java/org/adoptopenjdk/jitwatch/model/AnnotationException.java
AnnotationException
getMessage
StringBuilder builder = new StringBuilder(); builder.append(super.getMessage()); builder.append(" at offset: ").append(bytecodeOffset).append(C_SPACE); builder.append("but was mnemonic: "); if (instruction != null && instruction.getOpcode() != null) { builder.append(instruction.getOpcode().getMnemonic...
class AnnotationException extends Exception { private static final long serialVersionUID = 1L; private int bytecodeOffset; private BytecodeInstruction instruction; public AnnotationException(String msg, int offset, BytecodeInstruction instruction) { super(msg); this.bytecodeOffset = offset; this.instructio...
152
139
291
return super.getMessage() + " at offset " + bytecodeOffset + " of " + instruction;
<COMPILED_SUCCESSFULLY>
AdoptOpenJDK_jitwatch
jitwatch/core/src/main/java/org/adoptopenjdk/jitwatch/model/CodeCacheEvent.java
CodeCacheEvent
setNativeAddress
this.nativeAddress = address;
class CodeCacheEvent { public enum CodeCacheEventType { COMPILATION, SWEEPER, CACHE_FULL }; private CodeCacheEventType eventType; private long stamp; private long nativeCodeSize; private long freeCodeCache; private long nativeAddress; private Compilation compilation; private int compilationLevel; pub...
372
12
384
nativeAddress = address;
<COMPILED_SUCCESSFULLY>
AdoptOpenJDK_jitwatch
jitwatch/core/src/main/java/org/adoptopenjdk/jitwatch/model/CompilerThread.java
CompilerThread
getLatestNMethodEmittedTime
long result = 0; if (!compilations.isEmpty()) { Compilation first = compilations.get(0); result = first.getStampNMethodEmitted(); } for (Compilation compilation : compilations) { long emitted = compilation.getStampNMethodEmitted(); if (emitted > result) { result = emitted; } ...
class CompilerThread { private String threadId; private String threadName; private List<Compilation> compilations; public String getThreadId() { return threadId; } public CompilerThread(String threadId, String threadName) { this.threadId = threadId; this.threadName = threadName; compilations = new ...
609
128
737
long result = 0; if (!compilations.isEmpty()) { Compilation first = compilations.get(0); result = first.getStampNMethodEmitted(); } for (Compilation compilation : compilations) { if (compilation.getStampNMethodEmitted() > result) { result = compilation.getStampNMethodEmitted(); } } ...
<COMPILED_SUCCESSFULLY>
AdoptOpenJDK_jitwatch
jitwatch/core/src/main/java/org/adoptopenjdk/jitwatch/model/EliminatedAllocation.java
EliminatedAllocation
getBytecodeOffset
return bytecodeOffset;
class EliminatedAllocation { private String type; private int bytecodeOffset; public String getType() { return type; } public void setType(String type) { this.type = type; } public int getBytecodeOffset() {<FILL_FUNCTION_BODY>} public void setBytecodeOffset(int bytecodeOffset) { this.bytecodeOffse...
155
10
165
return bytecodeOffset;
<COMPILED_SUCCESSFULLY>
AdoptOpenJDK_jitwatch
jitwatch/core/src/main/java/org/adoptopenjdk/jitwatch/model/JITEvent.java
JITEvent
toString
StringBuilder sb = new StringBuilder(); sb.append(StringUtil.formatTimestamp(stamp, true)).append(C_SPACE); sb.append(StringUtil.alignRight(eventType.getText(), 14)).append(C_SPACE).append(C_COLON).append(C_SPACE); sb.append(eventMember.toString()); return sb.toString()...
class JITEvent { private long stamp; private EventType eventType; private IMetaMember eventMember; public JITEvent(long stamp, EventType eventType, IMetaMember eventMember) { this.stamp = stamp; this.eventType = eventType; this.eventMember = eventMember; } public lo...
181
102
283
return "JITEvent{" + "stamp=" + stamp + ", eventType=" + eventType + ", eventMember=" + eventMember + '}';
<COMPILED_SUCCESSFULLY>
AdoptOpenJDK_jitwatch
jitwatch/core/src/main/java/org/adoptopenjdk/jitwatch/model/JITStats.java
JITStats
incCountProtected
countProtected++;
class JITStats { // method modifiers private long countPrivate = 0; private long countProtected = 0; private long countPublic = 0; private long countStatic = 0; private long countFinal = 0; private long countSynchronized = 0; private long countStrictfp = 0; private long countNative = 0; private long countAbst...
1,245
12
1,257
countProtected++;
<COMPILED_SUCCESSFULLY>
AdoptOpenJDK_jitwatch
jitwatch/core/src/main/java/org/adoptopenjdk/jitwatch/model/MetaConstructor.java
MetaConstructor
toString
String methodSigWithoutThrows = constructorToString; int closingParentheses = methodSigWithoutThrows.indexOf(JITWatchConstants.S_CLOSE_PARENTHESES); if (closingParentheses != methodSigWithoutThrows.length() - 1) { methodSigWithoutThrows = methodSigWithoutThrows.substring(0, closingParentheses + 1); } ...
class MetaConstructor extends AbstractMetaMember { private String constructorToString; public MetaConstructor(Constructor<?> constructor, MetaClass methodClass) { super(StringUtil.getUnqualifiedMemberName(constructor.getName())); this.constructorToString = constructor.toString(); this.metaClass = methodCla...
201
123
324
return constructorToString;
<COMPILED_SUCCESSFULLY>
Logger logger=LoggerFactory.getLogger(AbstractMetaMember.class);MetaClass metaClass;List<Compilation> compilations;int selectedCompilationIndex;boolean isCompiled=false;boolean isVarArgs=false;boolean isPolymorphicSignature=false;int modifier;String memberName;Class<?> returnType;List<Class<?>> paramTypes;void checkPol...
AdoptOpenJDK_jitwatch
jitwatch/core/src/main/java/org/adoptopenjdk/jitwatch/model/NumberedLine.java
NumberedLine
getLine
return line;
class NumberedLine { private long lineNumber; private String line; public long getLineNumber() { return lineNumber; } public void setLineNumber(long lineNumber) { this.lineNumber = lineNumber; } public String getLine() {<FILL_FUNCTION_BODY>} public void setLine(String line) { this.line = line; } ...
143
8
151
return line;
<COMPILED_SUCCESSFULLY>
AdoptOpenJDK_jitwatch
jitwatch/core/src/main/java/org/adoptopenjdk/jitwatch/model/ParsedClasspath.java
ParsedClasspath
getClassLocations
List<String> asList = new ArrayList<>(classLocationSet); Collections.sort(asList); return Collections.unmodifiableList(asList);
class ParsedClasspath { private Set<String> classLocationSet = new HashSet<>(); public void clear() { classLocationSet.clear(); } public void addClassLocation(String location) { classLocationSet.add(location); } public List<String> getClassLocations() {<FILL_FUNCTION_BODY>} }
100
49
149
return new ArrayList<>(classLocationSet);
<COMPILED_SUCCESSFULLY>
AdoptOpenJDK_jitwatch
jitwatch/core/src/main/java/org/adoptopenjdk/jitwatch/model/SplitLog.java
SplitLog
addAssemblyLine
assemblyLines.add(line);
class SplitLog { private List<NumberedLine> headerLines = new ArrayList<>(); private List<NumberedLine> classLoaderLines = new ArrayList<>(); private List<NumberedLine> compilationLines = new ArrayList<>(); private List<NumberedLine> assemblyLines = new ArrayList<>(); public void clear() { headerLines.clear()...
382
14
396
assemblyLines.add(line);
<COMPILED_SUCCESSFULLY>
AdoptOpenJDK_jitwatch
jitwatch/core/src/main/java/org/adoptopenjdk/jitwatch/model/Task.java
Task
addBCIOpcodeMapping
if (DEBUG_LOGGING_PARSE_DICTIONARY) { logger.debug("Adding bci mapping: {} {} {}", methodID, bci, opcode); } parseDictionary.putBCIOpcode(methodID, bci, opcode);
class Task extends Tag { private static final Logger logger = LoggerFactory.getLogger(Task.class); private IParseDictionary parseDictionary; public Task(String attributeString, boolean selfClosing) { super(TAG_TASK, attributeString, selfClosing); parseDictionary = new ParseDictionary(getAttributes().get(ATT...
844
74
918
parseDictionary.putBCIOpcodeMapping(methodID, bci, opcode);
<COMPILED_SUCCESSFULLY>
String name;String attributeString;List<Tag> children=newArrayList<>();Tag parent=null;boolean selfClosing=false;boolean isFragment=false;String textContent=null;String INDENT=" ";void addTextContent( String text){};String getTextContent(){};void addChild( Tag child){};List<Tag> getChildren(){};boolean isSelfClosing...
AdoptOpenJDK_jitwatch
jitwatch/core/src/main/java/org/adoptopenjdk/jitwatch/model/assembly/AssemblyInstruction.java
AssemblyInstruction
toString
StringBuilder builder = new StringBuilder(); builder.append(StringUtil.alignLeft(annotation, annoWidth)); if (useLocalLabels) { labels.formatAddress(address, builder); } else { builder.append(S_HEX_PREFIX).append(StringUtil.pad(Long.toHexString(address), 16, '0', true)); } builder.append(C_C...
class AssemblyInstruction { private String annotation; private long address; private List<String> prefixes; private String mnemonic; private List<String> operands = new ArrayList<>(); private List<String> commentLines = new ArrayList<>(); private final AssemblyLabels labels; private boolean isSafePoint = false;...
1,349
572
1,921
StringBuilder builder = new StringBuilder(); builder.append(StringUtil.alignLeft(annotation, annoWidth)); if (useLocalLabels) { labels.formatAddress(address, builder); } else { builder.append(S_HEX_PREFIX).append(StringUtil.pad(Long.toHexString(address), 16, '0', true)); } builder.append(C_C...
<COMPILED_SUCCESSFULLY>
AdoptOpenJDK_jitwatch
jitwatch/core/src/main/java/org/adoptopenjdk/jitwatch/model/assembly/AssemblyReference.java
AssemblyReference
lookupMnemonic
String result = mnemonicMap.get(mnemonic); if (result == null) { // check if it has a size suffix (b,w,l,q) if (mnemonic.endsWith("b") || mnemonic.endsWith("w") || mnemonic.endsWith("l") || mnemonic.endsWith("q")) { result = mnemonicMap.get(mnemonic.substring(0, mnemonic.length() - 1)); } } ...
class AssemblyReference { private static Map<String, String> mnemonicMap = new HashMap<>(); private static final String TAG_MNEM_OPEN = "<mnem>"; private static final String TAG_MNEM_CLOSE = "</mnem>"; private static final String TAG_BRIEF_OPEN = "<brief>"; private static final String TAG_BRIEF_CLOSE = "</brief>"...
948
145
1,093
return mnemonicMap.get(mnemonic);
<COMPILED_SUCCESSFULLY>
AdoptOpenJDK_jitwatch
jitwatch/core/src/main/java/org/adoptopenjdk/jitwatch/model/assembly/arm/AssemblyParserARM.java
AssemblyParserARM
createInstruction
if (DEBUG_LOGGING_ASSEMBLY) { logger.debug("Trying to parse instruction : {}", inLine); } String line = inLine; AssemblyInstruction instr = null; String annotation = S_EMPTY; if (!line.startsWith(S_HEX_PREFIX)) { int addressIndex = line.indexOf(' ' + S_HEX_PREFIX); if (addressIndex != -1)...
class AssemblyParserARM extends AbstractAssemblyParser { private static final String PART_ADDRESS = "(" + S_HEX_PREFIX + "[a-f0-9]+):"; private static final String PART_INSTRUCTION = "([0-9a-zA-Z:_()[]{}+*$#,-%s]+)"; private static final String PART_COMMENT = "([;].*)?"; private static final Pattern ASSEMBLY_CONST...
1,280
518
1,798
Matcher matcher = PATTERN_ASSEMBLY_INSTRUCTION.matcher(inLine); if (matcher.matches()) { String address = matcher.group(1); String instruction = matcher.group(2); String comment = matcher.group(3); if (DEBUG_LOGGING_ASSEMBLY) { logger.debug("address: '{}'", address); logger.debug("instru...
<COMPILED_SUCCESSFULLY>
Logger logger=LoggerFactory.getLogger(AbstractAssemblyParser.class);Architecture architecture;Architecture getArchitecture(){};AssemblyMethod parseAssembly( final String assemblyString){};boolean isAddress( String mnemonic, String operand){}
AdoptOpenJDK_jitwatch
jitwatch/core/src/main/java/org/adoptopenjdk/jitwatch/model/bytecode/BCParamNumeric.java
BCParamNumeric
toString
return Integer.toString(value);
class BCParamNumeric implements IBytecodeParam { private int value; public BCParamNumeric(int value) { this.value = value; } @Override public String toString() {<FILL_FUNCTION_BODY>} @Override public Integer getValue() { return value; } }
87
12
99
return String.valueOf(value);
<COMPILED_SUCCESSFULLY>
AdoptOpenJDK_jitwatch
jitwatch/core/src/main/java/org/adoptopenjdk/jitwatch/model/bytecode/BCParamSwitch.java
BCParamSwitch
put
table.put(key, value);
class BCParamSwitch implements IBytecodeParam { private Map<String, String> table = new HashMap<>(); public BCParamSwitch() { } public void put(String key, String value) {<FILL_FUNCTION_BODY>} @Override public String toString() { StringBuilder builder = new StringBuilder(); List<String> keyList = new A...
388
14
402
table.put(key, value);
<COMPILED_SUCCESSFULLY>
AdoptOpenJDK_jitwatch
jitwatch/core/src/main/java/org/adoptopenjdk/jitwatch/model/bytecode/BytecodeInstruction.java
BytecodeInstruction
toStringSwitch
int maxLines = getLabelLines(); StringBuilder toStringBuilder = new StringBuilder(); int offsetWidth = Integer.toString(maxOffset).length(); if (line == 0) { toStringBuilder.append(StringUtil.alignRight(offset, offsetWidth)).append(C_COLON).append(C_SPACE); toStringBuilder.append(opcode.getMnemonic...
class BytecodeInstruction { private int offset; private Opcode opcode; private List<IBytecodeParam> parameters = new ArrayList<>(); private boolean hasComment; private String comment; private static final Logger logger = LoggerFactory.getLogger(BytecodeInstruction.class); public int getOffset() { return o...
1,635
330
1,965
StringBuilder toStringBuilder = new StringBuilder(); int offsetWidth = Integer.toString(maxOffset).length(); toStringBuilder.append(StringUtil.alignRight(offset, offsetWidth)).append(C_COLON).append(C_SPACE); if (opcode != null) { String mnemonic = opcode.getMnemonic(); toStringBuilder.append(Strin...
<COMPILED_SUCCESSFULLY>
AdoptOpenJDK_jitwatch
jitwatch/core/src/main/java/org/adoptopenjdk/jitwatch/model/bytecode/ClassBC.java
ClassBC
getMemberBytecode
if (DEBUG_LOGGING_BYTECODE) { logger.debug("getMemberBytecode: {}", member); } MemberBytecode result = null; if (member != null) { for (MemberBytecode item : memberBytecodeList) { if (member.matchesSignature(item.getMemberSignatureParts(), true)) { result = item; break; } ...
class ClassBC { private ConstantPool constantPool; private String sourceFile; private String moduleName; private int majorVersion; private int minorVersion; private String fqClassName; private List<MemberBytecode> memberBytecodeList = new ArrayList<>(); private List<String> innerClassNames = new ArrayList...
1,189
167
1,356
if (DEBUG_LOGGING_BYTECODE) { logger.debug("getMemberBytecode: {}", member); } MemberBytecode result = null; if (member != null) { for (MemberBytecode item : memberBytecodeList) { if (member.equals(item.getMember())) { result = item; break; } } } if (DEBUG_LOGGING_B...
<COMPILED_SUCCESSFULLY>
AdoptOpenJDK_jitwatch
jitwatch/core/src/main/java/org/adoptopenjdk/jitwatch/model/bytecode/ExceptionTable.java
ExceptionTable
toString
StringBuilder builder = new StringBuilder(); builder.append("from t to t target t typen"); for (ExceptionTableEntry entry : entries) { builder.append(entry.toString()).append(S_NEWLINE); } return builder.toString();
class ExceptionTable { private List<ExceptionTableEntry> entries; public ExceptionTable() { entries = new ArrayList<>(); } public void add(ExceptionTableEntry entry) { entries.add(entry); } public ExceptionTableEntry getEntryForBCI(int bci) { ExceptionTableEntry result = null; for (ExceptionTableEn...
218
79
297
return entries.toString();
<COMPILED_SUCCESSFULLY>
AdoptOpenJDK_jitwatch
jitwatch/core/src/main/java/org/adoptopenjdk/jitwatch/model/bytecode/ExceptionTableEntry.java
ExceptionTableEntry
toString
StringBuilder builder = new StringBuilder(); builder.append(from).append(" t "); builder.append(to).append( "t "); builder.append(target).append(" t "); builder.append(type); return builder.toString();
class ExceptionTableEntry { private int from; private int to; private int target; private String type; public int getFrom() { return from; } public int getTo() { return to; } public int getTarget() { return target; } public String getType() { return type; } public ExceptionTableEntry(int f...
173
75
248
return "from: " + from + " to: " + to + " target: " + target + " type: " + type;
<COMPILED_SUCCESSFULLY>
AdoptOpenJDK_jitwatch
jitwatch/core/src/main/java/org/adoptopenjdk/jitwatch/model/bytecode/InnerClassRelationship.java
InnerClassRelationship
parse
InnerClassRelationship result = null; Matcher matcher = PATTERN.matcher(line); if (matcher.find()) { result = new InnerClassRelationship(); result.childClass = (matcher.group(1) == null) ? null : matcher.group(1).replace(S_SLASH, S_DOT); result.parentClass = (matcher.group(2) == null) ? null :...
class InnerClassRelationship { private String parentClass; private String childClass; private static final Pattern PATTERN = Pattern.compile("^.*class (.*) of class (.*)"); private InnerClassRelationship() { } public static InnerClassRelationship parse(String line) {<FILL_FUNCTION_BODY>} public String ...
177
154
331
Matcher matcher = PATTERN.matcher(line); if (matcher.matches()) { InnerClassRelationship relationship = new InnerClassRelationship(); relationship.parentClass = matcher.group(1); relationship.childClass = matcher.group(2); return relationship; } else { return null; }
<COMPILED_SUCCESSFULLY>
AdoptOpenJDK_jitwatch
jitwatch/core/src/main/java/org/adoptopenjdk/jitwatch/model/bytecode/MemberBytecode.java
MemberBytecode
addExceptionTableEntry
exceptionTable.add(entry);
class MemberBytecode { private List<BytecodeInstruction> bytecodeInstructions = new ArrayList<>(); private LineTable lineTable; private ExceptionTable exceptionTable; private MemberSignatureParts msp; private ClassBC classBytecode; private int size = 0; private static final Logger logger = LoggerFactory.ge...
1,176
13
1,189
exceptionTable.add(entry);
<COMPILED_SUCCESSFULLY>
AdoptOpenJDK_jitwatch
jitwatch/core/src/main/java/org/adoptopenjdk/jitwatch/model/bytecode/SourceMapper.java
SourceMapper
getClassBytecodeList
String fqName = getFullyQualifiedSourceName(classBytecode); List<ClassBC> result = sourceToClassMap.get(fqName); if (result == null) { result = new ArrayList<>(); } return Collections.unmodifiableList(result);
class SourceMapper { private static final Logger logger = LoggerFactory.getLogger(SourceMapper.class); private static Map<String, List<ClassBC>> sourceToClassMap = new HashMap<>(); public static void clear() { sourceToClassMap.clear(); } private static String getFullyQualifiedSourceName(ClassBC classBytecode...
831
83
914
List<ClassBC> result = null; String fqName = getFullyQualifiedSourceName(classBytecode); result = sourceToClassMap.get(fqName); if (result == null) { result = Collections.emptyList(); } return result;
<COMPILED_SUCCESSFULLY>
AdoptOpenJDK_jitwatch
jitwatch/core/src/main/java/org/adoptopenjdk/jitwatch/parser/j9/J9Util.java
J9Util
parseLine
J9Line result = new J9Line(); int closeParentheses = line.indexOf(')'); if (closeParentheses != -1) { int openParentheses = line.indexOf('('); if (openParentheses != -1 && openParentheses < closeParentheses) { String temperature = line.substring(openParentheses + 1, closeParentheses); resu...
class J9Util { public static J9Line parseLine(String line) {<FILL_FUNCTION_BODY>} public static String convertJ9SigToLogCompilationSignature(String j9Signature) { return j9Signature.replace(C_DOT, C_SPACE).replace("(", " ("); } }
86
352
438
String[] parts = line.split("\\s+"); J9Line j9Line = new J9Line(); j9Line.setLineNumber(Integer.parseInt(parts[0])); j9Line.setMethodName(parts[1]); j9Line.setClassName(parts[2]); j9Line.setSignature(parts[3]); j9Line.setSourceFileName(parts[4]); j9Line.setSourceLineNumber(Integer.parseInt(parts[5])); ...
<COMPILED_SUCCESSFULLY>
AdoptOpenJDK_jitwatch
jitwatch/core/src/main/java/org/adoptopenjdk/jitwatch/parser/zing/ZingLine.java
ZingLine
getMemberSignatureParts
return MemberSignatureParts.fromLogCompilationSignature(signature);
class ZingLine { private int compileId; private int tier; private int bytecodeSize; private int nativeSize; private int score; private boolean throwsExceptions; private boolean stashedCompile; private long timestampMillisQueued; private long timestampMillisCompileStart; private long timestampMillisNMethodEmit...
1,778
19
1,797
return new MemberSignatureParts(signature);
<COMPILED_SUCCESSFULLY>
AdoptOpenJDK_jitwatch
jitwatch/core/src/main/java/org/adoptopenjdk/jitwatch/process/compiler/CompilerGroovy.java
CompilerGroovy
compile
List<String> commands = new ArrayList<>(); commands.add(compilerPath.toString()); String outputDirPath = outputDir.getAbsolutePath().toString(); List<String> compileOptions = Arrays.asList(new String[] { "-d", outputDirPath }); commands.addAll(vmOptions); commands.addAll(compileOptions); if (classpa...
class CompilerGroovy extends AbstractProcess implements ICompiler { private Path compilerPath; private final String COMPILER_NAME = "groovyc"; public CompilerGroovy(String languageHomeDir) throws FileNotFoundException { super(); compilerPath = Paths.get(languageHomeDir, "bin", COMPILER_NAME); if (!compi...
219
202
421
List<String> command = new ArrayList<>(); command.add(compilerPath.toString()); for (String entry : classpathEntries) { command.add("-cp"); command.add(entry); } for (String option : vmOptions) { command.add("-J"); command.add(option); } command.add("-d"); command.add(outputDir.getA...
<COMPILED_SUCCESSFULLY>
Logger logger=LoggerFactory.getLogger(RuntimeJava.class);Path stdErr;Path stdOut;String getExecutableSuffix(){};String getLaunchScriptSuffix(){};boolean isWindows(){};String getOutputStream(){};String getErrorStream(){};String makeClassPath( List<String> classpathEntries){};boolean runCommands( List<String> commands,...
AdoptOpenJDK_jitwatch
jitwatch/core/src/main/java/org/adoptopenjdk/jitwatch/process/compiler/CompilerJava.java
CompilerJava
compile
List<String> commands = new ArrayList<>(); String outputDirPath = outputDir.getAbsolutePath().toString(); commands.add(compilerPath.toString()); List<String> compileOptions = Arrays.asList(new String[] { "-g", "-d", outputDirPath }); commands.addAll(vmOptions); commands.addAll(compileOptions); if (c...
class CompilerJava extends AbstractProcess implements ICompiler { private Path compilerPath; private final String COMPILER_NAME = "javac" + getExecutableSuffix(); public CompilerJava(String languageHomeDir) throws FileNotFoundException { super(); compilerPath = Paths.get(languageHomeDir, "..", "bin", COMPILE...
265
204
469
List<String> command = new ArrayList<>(); command.add(compilerPath.toString()); for (String entry : classpathEntries) { command.add("-cp"); command.add(entry); } for (String option : vmOptions) { command.add("-J"); command.add(option); } command.add("-d"); command.add(outputDir.getA...
<COMPILED_SUCCESSFULLY>
Logger logger=LoggerFactory.getLogger(RuntimeJava.class);Path stdErr;Path stdOut;String getExecutableSuffix(){};String getLaunchScriptSuffix(){};boolean isWindows(){};String getOutputStream(){};String getErrorStream(){};String makeClassPath( List<String> classpathEntries){};boolean runCommands( List<String> commands,...
AdoptOpenJDK_jitwatch
jitwatch/core/src/main/java/org/adoptopenjdk/jitwatch/process/compiler/CompilerJavaScript.java
CompilerJavaScript
compile
List<String> commands = new ArrayList<>(); commands.add(compilerPath.toString()); String outputDirPath = outputDir.getAbsolutePath().toString(); // TODO support optimistic typing shortcuts List<String> compileOptions = Arrays.asList(new String[] { "-ot=false", "-co", "--dump-debug-dir=" + outputDirPath })...
class CompilerJavaScript extends AbstractProcess implements ICompiler { private Path compilerPath; private final String COMPILER_NAME = "jjs"; public CompilerJavaScript(String languageHomeDir) throws FileNotFoundException { super(); compilerPath = Paths.get(languageHomeDir, "bin", COMPILER_NAME); if (!com...
212
226
438
List<String> command = new ArrayList<>(); command.add(compilerPath.toString()); for (String entry : classpathEntries) { command.add("-classpath"); command.add(entry); } for (String option : vmOptions) { command.add("-J" + option); } command.add("-d"); command.add(outputDir.getAbsoluteP...
<COMPILED_SUCCESSFULLY>
Logger logger=LoggerFactory.getLogger(RuntimeJava.class);Path stdErr;Path stdOut;String getExecutableSuffix(){};String getLaunchScriptSuffix(){};boolean isWindows(){};String getOutputStream(){};String getErrorStream(){};String makeClassPath( List<String> classpathEntries){};boolean runCommands( List<String> commands,...
AdoptOpenJDK_jitwatch
jitwatch/core/src/main/java/org/adoptopenjdk/jitwatch/process/compiler/CompilerKotlin.java
CompilerKotlin
compile
List<String> commands = new ArrayList<>(); commands.add(compilerPath.toString()); String outputDirPath = outputDir.getAbsolutePath().toString(); List<String> compileOptions = Arrays.asList(new String[] { "-include-runtime", "-d", outputDirPath + File.separator + KOTLIN_EXECUTABLE_JAR }); comma...
class CompilerKotlin extends AbstractProcess implements ICompiler { private Path compilerPath; private final String COMPILER_NAME = "kotlinc-jvm"; public static final String KOTLIN_EXECUTABLE_JAR = "jitwatch-sandbox-kotlin.jar"; public CompilerKotlin(String languageHomeDir) throws FileNotFoundException { super...
251
232
483
List<String> command = new ArrayList<>(); command.add(compilerPath.toString()); command.add("-d"); command.add(outputDir.getAbsolutePath()); command.add("-cp"); command.add(String.join(File.pathSeparator, classpathEntries)); command.addAll(sourceFiles.stream().map(File::getAbsolutePath).collect(Collector...
<COMPILED_SUCCESSFULLY>
Logger logger=LoggerFactory.getLogger(RuntimeJava.class);Path stdErr;Path stdOut;String getExecutableSuffix(){};String getLaunchScriptSuffix(){};boolean isWindows(){};String getOutputStream(){};String getErrorStream(){};String makeClassPath( List<String> classpathEntries){};boolean runCommands( List<String> commands,...
AdoptOpenJDK_jitwatch
jitwatch/core/src/main/java/org/adoptopenjdk/jitwatch/process/compiler/CompilerScala.java
CompilerScala
addScalaCoreLibs
String[] coreLibs = Paths.get(languageHomeDir, "lib").toFile().list(new FilenameFilter() { @Override public boolean accept(File dir, String name) { return name.endsWith(".jar"); } }); for (String filename : coreLibs) { if (!classpathEntries.contains(filename)) { classpathEntr...
class CompilerScala extends AbstractProcess implements ICompiler { private Path compilerPath; private String languageHomeDir; private final String COMPILER_NAME = "scalac"; public CompilerScala(String languageHomeDir) throws FileNotFoundException { super(); this.languageHomeDir = languageHomeDir; com...
691
124
815
classpathEntries.add(Paths.get(languageHomeDir, "lib", "scala-library.jar").toString()); classpathEntries.add(Paths.get(languageHomeDir, "lib", "scala-compiler.jar").toString()); classpathEntries.add(Paths.get(languageHomeDir, "lib", "scala-reflect.jar").toString()); classpathEntries.add(Paths.get(languageHome...
<COMPILED_SUCCESSFULLY>
Logger logger=LoggerFactory.getLogger(RuntimeJava.class);Path stdErr;Path stdOut;String getExecutableSuffix(){};String getLaunchScriptSuffix(){};boolean isWindows(){};String getOutputStream(){};String getErrorStream(){};String makeClassPath( List<String> classpathEntries){};boolean runCommands( List<String> commands,...
AdoptOpenJDK_jitwatch
jitwatch/core/src/main/java/org/adoptopenjdk/jitwatch/process/javap/JavapProcess.java
JavapProcess
getJavapCommands
String[] args; if (classLocations == null || classLocations.isEmpty()) { args = new String[] { "-c", "-p", "-v", fqClassName }; } else { StringBuilder classPathBuilder = new StringBuilder(); for (String cp : classLocations) { classPathBuilder.append(cp).append(File.pathSeparatorChar); ...
class JavapProcess extends AbstractProcess { private Path executablePath; private final String EXECUTABLE_NAME = "javap" + getExecutableSuffix(); public JavapProcess(Path executablePath) { this.executablePath = executablePath; logger.info("JavapProcess({})", executablePath); } public JavapProcess() throws...
464
224
688
List<String> commands = new ArrayList<>(); commands.add(executablePath.toString()); commands.add("-classpath"); commands.add(StringUtils.join(classLocations, File.pathSeparator)); commands.add(fqClassName); return commands;
<COMPILED_SUCCESSFULLY>
Logger logger=LoggerFactory.getLogger(RuntimeJava.class);Path stdErr;Path stdOut;String getExecutableSuffix(){};String getLaunchScriptSuffix(){};boolean isWindows(){};String getOutputStream(){};String getErrorStream(){};String makeClassPath( List<String> classpathEntries){};boolean runCommands( List<String> commands,...
AdoptOpenJDK_jitwatch
jitwatch/core/src/main/java/org/adoptopenjdk/jitwatch/process/javap/ReflectionJavap.java
ReflectionJavap
canUseReflectionJavap
if (!canUseReflectionJavap) { boolean available = false; try { classJavapTask = Class.forName(JAVAPTASK_CLASS); } catch (ClassNotFoundException cnfe) { URL toolsJarURL = locateToolsJar(); if (toolsJarURL != null) { List<URL> urls = new ArrayList<>(); urls.add(toolsJar...
class ReflectionJavap { private static final Logger logger = LoggerFactory.getLogger(ReflectionJavap.class); private static final String JAVAPTASK_CLASS = "com.sun.tools.javap.JavapTask"; private static final int BUFFER_SIZE = 64 * 1024; private static boolean hasCheckedForToolsJar = false; private static bool...
858
384
1,242
if (!hasCheckedForToolsJar) { hasCheckedForToolsJar = true; URL toolsJar = locateToolsJar(); if (toolsJar != null) { try { URLClassLoader classLoader = new URLClassLoader(new URL[] { toolsJar }); classJavapTask = classLoader.loadClass(JAVAPTASK_CLASS); canUseReflectionJavap =...
<COMPILED_SUCCESSFULLY>
AdoptOpenJDK_jitwatch
jitwatch/core/src/main/java/org/adoptopenjdk/jitwatch/process/runtime/RuntimeGroovy.java
RuntimeGroovy
addGroovyJars
File libDir = groovyLibDir.toFile(); String[] jars = libDir.list(new FilenameFilter() { @Override public boolean accept(File dir, String name) { return name.endsWith(".jar"); } }); for (String jar : jars) { classpathEntries.add(new File(libDir, jar).getAbsolutePath()); }
class RuntimeGroovy extends AbstractProcess implements IRuntime { private Path runtimePath; private Path groovyLibDir; private final String RUNTIME_NAME = "java" + getExecutableSuffix(); public RuntimeGroovy(String languageHomeDir) throws FileNotFoundException { super(); // Groovy is executed on the current...
520
115
635
classpathEntries.add(groovyLibDir.toString());
<COMPILED_SUCCESSFULLY>
Logger logger=LoggerFactory.getLogger(RuntimeJava.class);Path stdErr;Path stdOut;String getExecutableSuffix(){};String getLaunchScriptSuffix(){};boolean isWindows(){};String getOutputStream(){};String getErrorStream(){};String makeClassPath( List<String> classpathEntries){};boolean runCommands( List<String> commands,...
AdoptOpenJDK_jitwatch
jitwatch/core/src/main/java/org/adoptopenjdk/jitwatch/process/runtime/RuntimeJava.java
RuntimeJava
getClassToExecute
String packageName = S_EMPTY; try { List<String> lines = Files.readAllLines(fileToRun.toPath()); for (String line : lines) { if (line.startsWith("package ")) { packageName = line.substring("package".length()).trim(); packageName = packageName.replace(';', '.'); break; } }...
class RuntimeJava extends AbstractProcess implements IRuntime { private Path runtimePath; private final String RUNTIME_NAME = "java" + getExecutableSuffix(); public RuntimeJava(String languageHomeDir) throws FileNotFoundException { super(); runtimePath = Paths.get(languageHomeDir, "..", "bin", RUNTIME_NAME);...
445
181
626
return fileToRun.getName().replaceFirst("\\.class$", "");
<COMPILED_SUCCESSFULLY>
Logger logger=LoggerFactory.getLogger(RuntimeJava.class);Path stdErr;Path stdOut;String getExecutableSuffix(){};String getLaunchScriptSuffix(){};boolean isWindows(){};String getOutputStream(){};String getErrorStream(){};String makeClassPath( List<String> classpathEntries){};boolean runCommands( List<String> commands,...
AdoptOpenJDK_jitwatch
jitwatch/core/src/main/java/org/adoptopenjdk/jitwatch/process/runtime/RuntimeScala.java
RuntimeScala
getClassForTriView
// http://stackoverflow.com/questions/9350528/how-to-work-with-javap-for-scala-java-interoperability return getClassToExecute(fileToRun) + C_DOLLAR;
class RuntimeScala extends AbstractProcess implements IRuntime { private Path runtimePath; private final String RUNTIME_NAME = "scala"; public RuntimeScala(String languageHomeDir) throws FileNotFoundException { super(); runtimePath = Paths.get(languageHomeDir, "bin", RUNTIME_NAME); if (!runtimePath.toFile...
432
63
495
return getClassToExecute(fileToRun);
<COMPILED_SUCCESSFULLY>
Logger logger=LoggerFactory.getLogger(RuntimeJava.class);Path stdErr;Path stdOut;String getExecutableSuffix(){};String getLaunchScriptSuffix(){};boolean isWindows(){};String getOutputStream(){};String getErrorStream(){};String makeClassPath( List<String> classpathEntries){};boolean runCommands( List<String> commands,...
AdoptOpenJDK_jitwatch
jitwatch/core/src/main/java/org/adoptopenjdk/jitwatch/report/AbstractReportBuilder.java
AbstractReportBuilder
getReports
TreeVisitor.walkTree(model, this); findNonMemberReports(); Collections.sort(reportList, comparator); return reportList;
class AbstractReportBuilder extends AbstractCompilationVisitable implements ITreeVisitable { protected IReadOnlyJITDataModel model; protected List<Report> reportList; public AbstractReportBuilder(IReadOnlyJITDataModel model) { this.model = model; reportList = new ArrayList<>(); } public List<Report> g...
148
49
197
findNonMemberReports(); reportList.sort(comparator); return reportList;
<COMPILED_SUCCESSFULLY>
Set<String> ignoreTags=newHashSet<>();void handleOther( Tag tag){}
AdoptOpenJDK_jitwatch
jitwatch/core/src/main/java/org/adoptopenjdk/jitwatch/report/comparator/MemberComparator.java
MemberComparator
compare
return o2.getCaller().getFullyQualifiedMemberName().compareTo(o1.getCaller().getFullyQualifiedMemberName());
class MemberComparator implements Comparator<Report> { @Override public int compare(Report o1, Report o2) {<FILL_FUNCTION_BODY>} }
47
41
88
return o1.getMember().compareTo(o2.getMember());
<COMPILED_SUCCESSFULLY>
AdoptOpenJDK_jitwatch
jitwatch/core/src/main/java/org/adoptopenjdk/jitwatch/report/escapeanalysis/AbstractEscapeAnalysisWalker.java
AbstractEscapeAnalysisWalker
visit
if (metaMember != null && metaMember.isCompiled()) { for (Compilation compilation : metaMember.getCompilations()) { try { BytecodeAnnotations annotations = bcAnnotationBuilder.buildBytecodeAnnotations(metaMember, compilation.getIndex(), model); Set<IMetaMember> membersWithAnnotation...
class AbstractEscapeAnalysisWalker extends AbstractReportBuilder { private BytecodeAnnotationBuilder bcAnnotationBuilder; public AbstractEscapeAnalysisWalker(IReadOnlyJITDataModel model) { super(model); ignoreTags.add(TAG_KLASS); ignoreTags.add(TAG_TYPE); ignoreTags.add(TAG_DEPENDENCY); ignoreTags.add(TA...
481
396
877
List<LineAnnotation> annotations = bcAnnotationBuilder.getAnnotations(metaMember); if (hasInlineSuccessAnnotation(annotations)) { return; } for (LineAnnotation la : annotations) { if (filterLineAnnotation(la)) { continue; } addReport(la); }
<COMPILED_SUCCESSFULLY>
IReadOnlyJITDataModel model;List<Report> reportList;List<Report> getReports( Comparator<Report> comparator){};void findNonMemberReports();void reset(){};Set<String> ignoreTags=newHashSet<>();void handleOther( Tag tag){}
AdoptOpenJDK_jitwatch
jitwatch/core/src/main/java/org/adoptopenjdk/jitwatch/report/escapeanalysis/eliminatedallocation/EliminatedAllocationWalker.java
EliminatedAllocationWalker
filterLineAnnotation
return la.getType() == BCAnnotationType.ELIMINATED_ALLOCATION;
class EliminatedAllocationWalker extends AbstractEscapeAnalysisWalker { public EliminatedAllocationWalker(IReadOnlyJITDataModel model) { super(model); } @Override protected boolean filterLineAnnotation(LineAnnotation la) {<FILL_FUNCTION_BODY>} }
80
25
105
return la.getKind() == LineAnnotation.Kind.ALLOCATION;
<COMPILED_SUCCESSFULLY>
BytecodeAnnotationBuilder bcAnnotationBuilder;void findNonMemberReports(){};void visit( IMetaMember metaMember){};boolean filterLineAnnotation( LineAnnotation la);boolean hasInlineSuccessAnnotation( List<LineAnnotation> annotations){};void visitTag(Tag parseTag,IParseDictionary parseDictionary) throws LogParseExcept...
AdoptOpenJDK_jitwatch
jitwatch/core/src/main/java/org/adoptopenjdk/jitwatch/report/inlining/InliningWalker.java
InliningWalker
visit
if (metaMember != null && metaMember.isCompiled()) { for (Compilation compilation : metaMember.getCompilations()) { try { BytecodeAnnotations annotations = bcAnnotationBuilder.buildBytecodeAnnotations(metaMember, compilation.getIndex(), model); Set<IMetaMember> membersWithAnnotation...
class InliningWalker extends AbstractReportBuilder { private BytecodeAnnotationBuilder bcAnnotationBuilder; private IMetaMember member; public InliningWalker(IReadOnlyJITDataModel model, IMetaMember member) { super(model); this.member = member; bcAnnotationBuilder = new BytecodeAnnotationBuilder(false); ...
308
382
690
if (member.equals(metaMember)) { List<LineAnnotation> lineAnnotations = bcAnnotationBuilder.getLineAnnotations(metaMember); for (LineAnnotation la : lineAnnotations) { if (filterLineAnnotation(la, member)) { addReport(la); } } }
<COMPILED_SUCCESSFULLY>
IReadOnlyJITDataModel model;List<Report> reportList;List<Report> getReports( Comparator<Report> comparator){};void findNonMemberReports();void reset(){};Set<String> ignoreTags=newHashSet<>();void handleOther( Tag tag){}
AdoptOpenJDK_jitwatch
jitwatch/core/src/main/java/org/adoptopenjdk/jitwatch/report/locks/OptimisedLocksWalker.java
OptimisedLocksWalker
filterLineAnnotation
return la.getType() == BCAnnotationType.LOCK_ELISION;
class OptimisedLocksWalker extends AbstractEscapeAnalysisWalker { public OptimisedLocksWalker(IReadOnlyJITDataModel model) { super(model); } @Override protected boolean filterLineAnnotation(LineAnnotation la) {<FILL_FUNCTION_BODY>} }
78
22
100
return la.getAnnotation() == LineAnnotation.Annotation.LOCK;
<COMPILED_SUCCESSFULLY>
BytecodeAnnotationBuilder bcAnnotationBuilder;void findNonMemberReports(){};void visit( IMetaMember metaMember){};boolean filterLineAnnotation( LineAnnotation la);boolean hasInlineSuccessAnnotation( List<LineAnnotation> annotations){};void visitTag(Tag parseTag,IParseDictionary parseDictionary) throws LogParseExcept...
AdoptOpenJDK_jitwatch
jitwatch/core/src/main/java/org/adoptopenjdk/jitwatch/toplist/AbstractTopListVisitable.java
AbstractTopListVisitable
buildTopList
topList = new ArrayList<>(); TreeVisitor.walkTree(model, this); postProcess(); Collections.sort(topList, new Comparator<ITopListScore>() { @Override public int compare(ITopListScore s1, ITopListScore s2) { if (sortHighToLow) { return Long.compare(s2.getScore(), s1.getScore()); } ...
class AbstractTopListVisitable extends AbstractCompilationVisitable implements ITopListVisitable { protected IReadOnlyJITDataModel model; protected List<ITopListScore> topList; protected boolean sortHighToLow; protected static final Logger logger = LoggerFactory.getLogger(AbstractTopListVisitable.class...
225
163
388
postProcess(); return topList;
<COMPILED_SUCCESSFULLY>
Set<String> ignoreTags=newHashSet<>();void handleOther( Tag tag){}
End of preview. Expand in Data Studio

No dataset card yet

Downloads last month
17