Package org.teavm.common

Examples of org.teavm.common.RecordArray


    public Collection<GeneratedLocation> getGeneratedLocations(String fileName, int line) {
        Integer fileIndex = fileNameMap.get(fileName);
        if (fileIndex == null) {
            return Collections.emptyList();
        }
        RecordArray description = fileIndex >= 0 ? fileDescriptions[fileIndex] : null;
        if (description == null) {
            return Collections.emptyList();
        }
        if (line >= description.size()) {
            return Collections.emptyList();
        }
        int[] data = description.get(line).getArray(0);
        GeneratedLocation[] resultArray = new GeneratedLocation[data.length / 2];
        for (int i = 0; i < resultArray.length; ++i) {
            int genLine = data[i * 2];
            int genColumn = data[i * 2 + 1];
            resultArray[i] = new GeneratedLocation(genLine, genColumn);
View Full Code Here


    public String[] getVariableMeaningAt(GeneratedLocation location, String variable) {
        Integer varIndex = variableNameMap.get(variable);
        if (varIndex == null) {
            return new String[0];
        }
        RecordArray mapping = variableMappings[varIndex];
        if (mapping == null) {
            return new String[0];
        }
        int keyIndex = indexByKey(mapping, location);
        if (keyIndex < 0) {
            return new String[0];
        }
        GeneratedLocation keyLocation = key(mapping.get(keyIndex));
        if (!Objects.equals(getMethodAt(keyLocation), getMethodAt(location))) {
            return new String[0];
        }
        int[] valueIndexes = mapping.get(keyIndex).getArray(0);
        String[] result = new String[valueIndexes.length];
        for (int i = 0; i < result.length; ++i) {
            result[i] = variableNames[valueIndexes[i]];
        }
        return result;
View Full Code Here

    public SourceLocation[] getFollowingLines(SourceLocation location) {
        Integer fileIndex = fileNameMap.get(location.getFileName());
        if (fileIndex == null) {
            return null;
        }
        RecordArray cfg = controlFlowGraphs[fileIndex];
        if (cfg == null) {
            return null;
        }
        if (location.getLine() >= cfg.size()) {
            return null;
        }
        int type = cfg.get(location.getLine()).get(0);
        if (type == 0) {
            return null;
        }
        int[] data = cfg.get(location.getLine()).getArray(0);
        int length = data.length / 2;
        int size = length;
        if (type == 2) {
            ++size;
        }
View Full Code Here

    public DebuggerCallSite[] getCallSites(SourceLocation location) {
        Integer fileIndex = fileNameMap.get(location.getFileName());
        if (fileIndex == null) {
            return new DebuggerCallSite[0];
        }
        RecordArray mapping = lineCallSites[fileIndex];
        if (location.getLine() >= mapping.size()) {
            return new DebuggerCallSite[0];
        }
        int[] callSiteIds = mapping.get(location.getLine()).getArray(0);
        DebuggerCallSite[] callSites = new DebuggerCallSite[callSiteIds.length];
        for (int i = 0; i < callSiteIds.length; ++i) {
            callSites[i] = getCallSite(callSiteIds[i]);
        }
        return callSites;
View Full Code Here

    private void writeVariableMappings(DebugInformation debugInfo) throws IOException {
        int lastVar = 0;
        writeUnsignedNumber(nonNullVariableMappings(debugInfo));
        for (int i = 0; i < debugInfo.variableMappings.length; ++i) {
            RecordArray mapping = debugInfo.variableMappings[i];
            if (mapping == null) {
                continue;
            }
            writeUnsignedNumber(i - lastVar);
            lastVar = i;
View Full Code Here

TOP

Related Classes of org.teavm.common.RecordArray

Copyright © 2018 www.massapicom. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.