APISonar


org.graalvm.compiler.debug.Debug.log

> org > graalvm > compiler > debug > Debug > log
org APIs graalvm APIs compiler APIs debug APIs Debug APIs log APIs

Example 1
private void traceResult(Object result) {
        try (Scope s = Debug.scope("GNFI")) {
            if (Debug.isLogEnabled()) {
                Debug.log("[GNFI] %s --> %s", pointer.getName(), result);
            }
        }
    }
Example 2
private void printLiveSet(String label, BitSet liveSet) {
        if (Debug.isLogEnabled()) {
            try (Indent indent = Debug.logAndIndent(label)) {
                Debug.log("%s", liveSetToString(liveSet));
            }
        }
    }
Example 3
private void logIrreducibleLoops() {
        try (Debug.Scope s = Debug.scope("IrreducibleLoops")) {
            if (Debug.isLogEnabled(Debug.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(Debug.BASIC_LEVEL, "%s", msg);
            }
        }
    }
Example 4
public static void trace(OptionValues options, String msg) {
        if (Debug.isEnabled() && TraceEscapeAnalysis.getValue(options) && Debug.isLogEnabled()) {
            Debug.log(msg);
        }
    }
Example 5
private void markInInterval(BitSet inSet, int blockFirstOpId) {
        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 6
private void markOutInterval(BitSet outSet, int blockEndOpId) {
        for (int i = outSet.nextSetBit(0); i >= 0; i = outSet.nextSetBit(i + 1)) {
            StackInterval interval = getIntervalFromStackId(i);
            Debug.log("mark live operand: %s", interval.getOperand());
            interval.addTo(blockEndOpId);
        }
    }
Example 7
private void filteredPush(Deque<AbstractBlockBase<?>> worklist, AbstractBlockBase<?> block) {
        if (isMarked(block)) {
            Debug.log(Debug.VERBOSE_LEVEL, "adding %s to the worklist", block);
            worklist.offerLast(block);
        }
    }
Example 8
protected void printState(Interval[] inputState) {
        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
private List<AbstractBlockBase<?>> startTrace(AbstractBlockBase<?> block) {
        assert checkPredecessorsProcessed(block);
        ArrayList<AbstractBlockBase<?>> trace = new ArrayList<>();
        int blockNumber = 0;
        try (Indent i = Debug.logAndIndent("StartTrace: %s", block)) {
            for (AbstractBlockBase<?> currentBlock = block; currentBlock != null; currentBlock = selectNext(currentBlock)) {
                Debug.log("add %s (prob: %f)", currentBlock, currentBlock.probability());
                processed.set(currentBlock.getId());
                trace.add(currentBlock);
                unblock(currentBlock);
                currentBlock.setLinearScanNumber(blockNumber++);
            }
        }
        return trace;
    }
Example 10
private void doRoot(ValueNode instr) {
        if (traceLIRGeneratorLevel >= 2) {
            TTY.println("Emitting LIR for instruction " + instr);
        }
        currentInstruction = instr;

        Debug.log("Visiting %s", instr);
        emitNode(instr);
        Debug.log("Operand for %s = %s", instr, getOperand(instr));
    }
Example 11
private void processLocation(Node n, LocationIdentity location, EconomicSet<FloatingReadNode> currentState) {
        assert n != null;
        if (location.isImmutable()) {
            return;
        }

        for (FloatingReadNode r : cloneState(currentState)) {
            if (r.getLocationIdentity().overlaps(location)) {
                // This read is killed by this location.
                Debug.log(Debug.VERBOSE_LEVEL, "%s removing %s from state", n, r);
                currentState.remove(r);
            }
        }
    }
Example 12
public void visitFullInfopointNode(FullInfopointNode i) {
        if (i.getState() != null && i.getState().bci == BytecodeFrame.AFTER_BCI) {
            Debug.log("Ignoring InfopointNode for AFTER_BCI");
        } else {
            super.visitFullInfopointNode(i);
        }
    }
Example 13
private boolean traceSuccessor(BciBlock sux) {
        if (Debug.isLogEnabled()) {
            Debug.log("    Successor B%d: %s", sux.getId(), debugLiveIn(sux.getId()));
        }
        return true;
    }
Example 14
protected void handleSpillSlot(Interval interval) {
        assert interval.location() != null : "interval  not assigned " + interval;
        if (interval.canMaterialize()) {
            assert !isStackSlotValue(interval.location()) : "interval can materialize but assigned to a stack slot " + interval;
            return;
        }
        assert isStackSlotValue(interval.location()) : "interval not assigned to a stack slot " + interval;
        try (Scope s1 = Debug.scope("LSRAOptimization")) {
            Debug.log("adding stack to unhandled list %s", interval);
            unhandledLists.addToListSortedByStartAndUsePositions(RegisterBinding.Stack, interval);
        }
    }
Example 15
static void statePut(TraceInterval[] inputState, Value location, TraceInterval interval) {
        if (location != null && isRegister(location)) {
            Register reg = asRegister(location);
            int regNum = reg.number;
            if (interval != null) {
                Debug.log("%s = v%d", reg, interval.operandNumber);
            } else if (inputState[regNum] != null) {
                Debug.log("%s = null", reg);
            }

            inputState[regNum] = interval;
        }
    }
Example 16
public AbstractAddress recordDataReferenceInCode(Constant constant, int alignment) {
        assert constant != null;
        Debug.log("Constant reference in code: pos = %d, data = %s", asm.position(), constant);
        Data data = dataCache.get(constant);
        if (data == null) {
            data = dataBuilder.createDataItem(constant);
            dataCache.put(constant, data);
        }
        data.updateAlignment(alignment);
        return recordDataSectionReference(data);
    }
Example 17
public void traceState() {
        Debug.log("|   state [nr locals = %d, stack depth = %d, method = %s]", localsSize(), stackSize(), getMethod());
        for (int i = 0; i < localsSize(); ++i) {
            ValueNode value = locals[i];
            Debug.log("|   local[%d] = %-8s : %s", i, value == null ? "bogus" : value == TWO_SLOT_MARKER ? "second" : value.getStackKind().getJavaName(), value);
        }
        for (int i = 0; i < stackSize(); ++i) {
            ValueNode value = stack[i];
            Debug.log("|   stack[%d] = %-8s : %s", i, value == null ? "bogus" : value == TWO_SLOT_MARKER ? "second" : value.getStackKind().getJavaName(), value);
        }
    }
Example 18
private void intervalMoved(Interval 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(allocator));
        }
    }
Example 19
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 20
private static void logList(FixedInterval i) {
        for (FixedInterval interval = i; interval != FixedInterval.EndMarker; interval = interval.next) {
            Debug.log("%s", interval.logString());
        }
    }
Example 21
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
public void testDifferentLoopsInnerOuter() {
        HighTierContext htc = getDefaultHighTierContext();
        StructuredGraph g1 = parseForCompile(getResolvedJavaMethod("testLoop04"));
        StructuredGraph g2 = parseForCompile(getResolvedJavaMethod("testLoop05"));
        prepareGraphForLoopFrequencies(g1, htc);
        prepareGraphForLoopFrequencies(g2, htc);
        assertFrequency(g1, ITERATIONS_LOOP_1 * ITERATIONS_LOOP_2);
        GraphCostPhase gc1 = new GraphCostPhase();
        GraphCostPhase gc2 = new GraphCostPhase();
        gc1.apply(g1, htc);
        gc2.apply(g2, htc);
        Debug.log("Test testDifferentLoopsInnerOuter --> 1.Graph cycles:%f size:%f vs. 2.Graph cycles:%f size:%f\n", gc1.finalCycles, gc1.finalSize, gc2.finalCycles, gc2.finalSize);
        Assert.assertTrue(gc2.finalSize > gc1.finalSize);
    }
Example 23
private void blockRegisters(Interval interval) {
        Value location = interval.location();
        if (mightBeBlocked(location)) {
            assert areMultipleReadsAllowed() || valueBlocked(location) == 0 : "location already marked as used: " + location;
            int direction = 1;
            setValueBlocked(location, direction);
            Debug.log("block %s", location);
        }
    }
Example 24
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 25
public void recordInlineDataInCode(Constant data) {
        assert data != null;
        int pos = asm.position();
        Debug.log("Inline data in code: pos = %d, data = %s", pos, data);
        if (data instanceof VMConstant) {
            compilationResult.recordDataPatch(pos, new ConstantReference((VMConstant) data));
        }
    }