APISonar


org.graalvm.compiler.debug.DebugContext.log

> org > graalvm > compiler > debug > DebugContext > log
org APIs graalvm APIs compiler APIs debug APIs DebugContext APIs log APIs

Example 1
private final DebugContext debug;

    public void log(BciBlock[] blockMap, String name) {
        if (debug.isLogEnabled()) {
            debug.log("%sBlockMap %s: %n%s", debug.getCurrentScopeName(), name, toString(blockMap, loopHeaders));
        }
    }
Example 2
private void logIrreducibleLoops() {
        DebugContext debug = graph.getDebug();
        try (DebugContext.Scope s = debug.scope("IrreducibleLoops")) {
            if (debug.isLogEnabled(DebugContext.BASIC_LEVEL) && irreducibleLoopSwitch != null) {
                StringBuilder msg = new StringBuilder("Inserted state machine to remove irreducible loops. Dispatching to the following states: ");
                String sep = "";
                for (int i = 0; i < irreducibleLoopSwitch.keyCount(); i++) {
                    msg.append(sep).append(irreducibleLoopSwitch.keyAt(i).asInt());
                    sep = ", ";
                }
                debug.log(DebugContext.BASIC_LEVEL, "%s", msg);
            }
        }
    }
Example 3
private void printLiveSet(String label, BitSet liveSet) {
        DebugContext debug = lir.getDebug();
        if (debug.isLogEnabled()) {
            try (Indent indent = debug.logAndIndent(label)) {
                debug.log("%s", liveSetToString(liveSet));
            }
        }
    }
Example 4
private void markInInterval(BitSet inSet, int blockFirstOpId) {
        DebugContext debug = lir.getDebug();
        for (int i = inSet.nextSetBit(0); i >= 0; i = inSet.nextSetBit(i + 1)) {
            StackInterval interval = getIntervalFromStackId(i);
            debug.log("mark live operand: %s", interval.getOperand());
            interval.addFrom(blockFirstOpId);
        }
    }
Example 5
private void filteredPush(DebugContext debug, Deque<AbstractBlockBase<?>> worklist, AbstractBlockBase<?> block) {
        if (isMarked(block)) {
            debug.log(DebugContext.VERBOSE_LEVEL, "adding %s to the worklist", block);
            worklist.offerLast(block);
        }
    }
Example 6
public static void trace(OptionValues options, DebugContext debug, String msg) {
        if (debug.areScopesEnabled() && TraceEscapeAnalysis.getValue(options) && debug.isLogEnabled()) {
            debug.log(msg);
        }
    }
Example 7
private List<AbstractBlockBase<?>> findTrace(DebugContext debug, AbstractBlockBase<?> traceStart) {
        assert checkPredecessorsProcessed(traceStart);
        ArrayList<AbstractBlockBase<?>> trace = new ArrayList<>();
        int blockNumber = 0;
        try (Indent i = debug.logAndIndent("StartTrace: %s", traceStart)) {
            for (AbstractBlockBase<?> block = traceStart; block != null; block = selectNext(block)) {
                debug.log("add %s (prob: %f)", block, block.probability());
                processed.set(block.getId());
                trace.add(block);
                unblock(block);
                block.setLinearScanNumber(blockNumber++);
            }
        }
        return trace;
    }
Example 8
protected void printState(Interval[] inputState) {
        DebugContext debug = allocator.getDebug();
        for (int i = 0; i < stateSize(); i++) {
            Register reg = allocator.getRegisters().get(i);
            assert reg.number == i;
            if (inputState[i] != null) {
                debug.log(" %6s %4d  --  %s", reg, inputState[i].operandNumber, inputState[i]);
            } else {
                debug.log(" %6s   __", reg);
            }
        }
    }
Example 9
protected final DebugContext debug;

    boolean verify() {
        // (check that all intervals have a correct register and that no registers are overwritten)
        verifyIntervals();

        verifyRegisters();

        debug.log("no errors found");

        return true;
    }
Example 10
private static boolean traceIteration(DebugContext debug, int iteration) {
        debug.log("Iteration %d", iteration);
        return true;
    }
Example 11
private final DebugContext debug;

    public AbstractAddress recordDataReferenceInCode(byte[] data, int alignment) {
        assert data != null;
        if (debug.isLogEnabled()) {
            debug.log("Data reference in code: pos = %d, data = %s", asm.position(), Arrays.toString(data));
        }
        return recordDataSectionReference(new RawData(data, alignment));
    }
Example 12
private void doRoot(ValueNode instr) {
        if (traceLIRGeneratorLevel >= 2) {
            TTY.println("Emitting LIR for instruction " + instr);
        }
        currentInstruction = instr;
        DebugContext debug = instr.getDebug();
        debug.log("Visiting %s", instr);
        emitNode(instr);
        debug.log("Operand for %s = %s", instr, getOperand(instr));
    }
Example 13
private boolean traceSuccessor(DebugContext debug, BciBlock sux) {
        if (debug.isLogEnabled()) {
            debug.log("    Successor B%d: %s", sux.getId(), debugLiveIn(sux.getId()));
        }
        return true;
    }
Example 14
private final DebugContext debug;

    private void printMapping() {
        try (Indent indent = debug.logAndIndent("Mapping")) {
            for (int i = mappingFrom.size() - 1; i >= 0; i--) {
                debug.log("move %s <- %s (%s)", mappingTo.get(i), mappingFrom.get(i), mappingFromStack.get(i));
            }
        }
    }
Example 15
static void statePut(DebugContext debug, Interval[] inputState, Value location, Interval interval) {
        if (location != null && isRegister(location)) {
            Register reg = asRegister(location);
            int regNum = reg.number;
            if (interval != null) {
                debug.log("%s = %s", reg, interval.operand);
            } else if (inputState[regNum] != null) {
                debug.log("%s = null", reg);
            }

            inputState[regNum] = interval;
        }
    }
Example 16
private static void intervalMoved(DebugContext debug, IntervalHint interval, State from, State to) {
        // intervalMoved() is called whenever an interval moves from one interval list to another.
        // In the implementation of this method it is prohibited to move the interval to any list.
        if (debug.isLogEnabled()) {
            debug.log("interval moved from %s to %s: %s", from, to, interval.logString());
        }
    }
Example 17
private final DebugContext debug;

    public void addMapping(Constant fromOpr, TraceInterval toInterval) {
        if (debug.isLogEnabled()) {
            debug.log("add move mapping from %s to %s", fromOpr, toInterval);
        }

        mappingFrom.add(null);
        mappingFromOpr.add(fromOpr);
        mappingTo.add(toInterval);
    }
Example 18
private final DebugContext debug;

    private int findOptimalSpillPos(int minSpillPos, int maxSpillPos) {
        int optimalSpillPos = findOptimalSpillPos0(minSpillPos, maxSpillPos) & (~1);
        if (debug.isLogEnabled()) {
            debug.log("optimal spill position: %d", optimalSpillPos);
        }
        return optimalSpillPos;
    }
Example 19
private final DebugContext debug;

    private void unblock(Value location) {
        if (mightBeBlocked(location)) {
            assert valueBlocked(location) > 0 : "location already marked as unused: " + location;
            setValueBlocked(location, -1);
            debug.log("unblock %s", location);
        }
    }
Example 20
private static void logList(DebugContext debug, TraceInterval i) {
        for (TraceInterval interval = i; interval != TraceInterval.EndMarker; interval = interval.next) {
            debug.log("%s", interval.logString());
        }
    }
Example 21
private final DebugContext debug;

    private int findOptimalSplitPos(TraceInterval interval, int minSplitPos, int maxSplitPos, boolean doLoopOptimization) {
        int optimalSplitPos = findOptimalSplitPos0(minSplitPos, maxSplitPos);
        if (debug.isLogEnabled()) {
            debug.log("optimal split position: %d", optimalSplitPos);
        }
        return optimalSplitPos;
    }
Example 22
private final DebugContext debug;

    private void printRegisterState() {
        try (Indent indent2 = debug.logAndIndent("state of registers:")) {
            for (Register reg : availableRegs) {
                int i = reg.number;
                try (Indent indent3 = debug.logAndIndent("reg %d: usePos: %d, blockPos: %d, inMemory: %b, intervals: ", i, usePos[i], blockPos[i], isInMemory.get(i))) {
                    for (int j = 0; j < spillIntervals[i].size(); j++) {
                        debug.log("%s", spillIntervals[i].get(j));
                    }
                }
            }
        }
    }
Example 23
private final DebugContext debug;

    private void insertMove(Constant fromOpr, TraceInterval toInterval) {
        assert insertIdx != -1 : "must setup insert position first";

        AllocatableValue toOpr = allocator.getOperand(toInterval);
        LIRInstruction move = getAllocator().getSpillMoveFactory().createLoad(toOpr, fromOpr);
        insertionBuffer.append(insertIdx, move);

        if (debug.isLogEnabled()) {
            debug.log("insert move from value %s to %s at %d", fromOpr, toInterval, insertIdx);
        }
    }
Example 24
protected final DebugContext debug;

    private double[] switchProbability(int numberOfCases, int bci) {
        double[] prob = (profilingInfo == null ? null : profilingInfo.getSwitchProbabilities(bci));
        if (prob != null) {
            assert prob.length == numberOfCases;
        } else {
            debug.log("Missing probability (switch) in %s at bci %d", method, bci);
            prob = new double[numberOfCases];
            for (int i = 0; i < numberOfCases; i++) {
                prob[i] = 1.0d / numberOfCases;
            }
        }
        assert allPositive(prob);
        return prob;
    }
Example 25
private final DebugContext debug;

    public void addMapping(Value from, AllocatableValue to, Value fromStack) {
        if (debug.isLogEnabled()) {
            debug.log("add move mapping from %s to %s", from, to);
        }

        assert !from.equals(to) : "from and to interval equal: " + from;
        assert LIRKind.verifyMoveKinds(to.getValueKind(), from.getValueKind(), registerAllocationConfig) : String.format("Kind mismatch: %s vs. %s, from=%s, to=%s", from.getValueKind(),
                        to.getValueKind(), from, to);
        assert fromStack == null || LIRKind.verifyMoveKinds(to.getValueKind(), fromStack.getValueKind(), registerAllocationConfig) : String.format("Kind mismatch: %s vs. %s, fromStack=%s, to=%s",
                        fromStack.getValueKind(),
                        to.getValueKind(), fromStack, to);
        mappingFrom.add(from);
        mappingFromStack.add(fromStack);
        mappingTo.add(to);
    }