@Override public DeferredCallSite emitCallSite() { final RecordArrayBuilder.Record record = add(callSiteMapping, DebuggerCallSite.NONE); return new DeferredCallSite() { @Override
@Override public void emitLocation(String fileName, int line) { debugInformation = null; int fileIndex = files.index(fileName); if (!Objects.equals(currentFileName, fileName)) { add(fileMapping, fileIndex); currentFileName = fileName; } if (currentLine != line) { add(lineMapping, line); currentLine = line; } }
private RecordArrayBuilder.Record add(RecordArrayBuilder builder, int value) { RecordArrayBuilder.Record record = add(builder); record.set(2, value); return record; }
@Override public void emitClass(String className) { debugInformation = null; int classIndex = classes.index(className); if (!Objects.equals(className, currentClass)) { add(classMapping, classIndex); currentClass = className; } }
@Override public void emitMethod(MethodDescriptor method) { debugInformation = null; int methodIndex = methods.index(method != null ? method.toString() : null); if (!Objects.equals(method, currentMethod)) { add(methodMapping, methodIndex); currentMethod = method; } if (currentClass != null) { int classIndex = classes.index(currentClass); long fullIndex = ((long) classIndex << 32) | methodIndex; if (!exactMethodMap.containsKey(fullIndex)) { exactMethodMap.put(fullIndex, exactMethods.size()); exactMethods.add(fullIndex); } } }
@Override public void emitVariable(String[] sourceNames, String generatedName) { int[] sourceIndexes = new int[sourceNames.length]; for (int i = 0; i < sourceIndexes.length; ++i) { sourceIndexes[i] = variableNames.index(sourceNames[i]); } Arrays.sort(sourceIndexes); int generatedIndex = variableNames.index(generatedName); RecordArrayBuilder mapping = variableMappings.computeIfAbsent(generatedIndex, k -> new RecordArrayBuilder(2, 1)); RecordArrayBuilder.Record record = add(mapping); RecordArrayBuilder.SubArray array = record.getArray(0); for (int sourceIndex : sourceIndexes) { array.add(sourceIndex); } }
@Override public DeferredCallSite emitCallSite() { final RecordArrayBuilder.Record record = add(callSiteMapping, DebuggerCallSite.NONE); return new DeferredCallSite() { @Override
@Override public void emitLocation(String fileName, int line) { debugInformation = null; int fileIndex = files.index(fileName); if (!Objects.equals(currentFileName, fileName)) { add(fileMapping, fileIndex); currentFileName = fileName; } if (currentLine != line) { add(lineMapping, line); currentLine = line; } }
@Override public void emitClass(String className) { debugInformation = null; int classIndex = classes.index(className); if (!Objects.equals(className, currentClass)) { add(classMapping, classIndex); currentClass = className; } }
private RecordArrayBuilder.Record add(RecordArrayBuilder builder, int value) { RecordArrayBuilder.Record record = add(builder); record.set(2, value); return record; }
@Override public void emitMethod(MethodDescriptor method) { debugInformation = null; int methodIndex = methods.index(method != null ? method.toString() : null); if (!Objects.equals(method, currentMethod)) { add(methodMapping, methodIndex); currentMethod = method; } if (currentClass != null) { int classIndex = classes.index(currentClass); long fullIndex = ((long) classIndex << 32) | methodIndex; if (!exactMethodMap.containsKey(fullIndex)) { exactMethodMap.put(fullIndex, exactMethods.size()); exactMethods.add(fullIndex); } } }
@Override public void emitVariable(String[] sourceNames, String generatedName) { int[] sourceIndexes = new int[sourceNames.length]; for (int i = 0; i < sourceIndexes.length; ++i) { sourceIndexes[i] = variableNames.index(sourceNames[i]); } Arrays.sort(sourceIndexes); int generatedIndex = variableNames.index(generatedName); RecordArrayBuilder mapping = variableMappings.computeIfAbsent(generatedIndex, k -> new RecordArrayBuilder(2, 1)); RecordArrayBuilder.Record record = add(mapping); RecordArrayBuilder.SubArray array = record.getArray(0); for (int sourceIndex : sourceIndexes) { array.add(sourceIndex); } }