Search in sources :

Example 1 with LLVMDispatchBasicBlockNode

use of com.oracle.truffle.llvm.runtime.nodes.control.LLVMDispatchBasicBlockNode in project graal by oracle.

the class LLVMDebuggerScopeFactory method getVariables.

@TruffleBoundary
private LLVMDebuggerScopeEntries getVariables(Frame frame) {
    if (symbols.isEmpty()) {
        return LLVMDebuggerScopeEntries.EMPTY_SCOPE;
    }
    final LLVMDebuggerScopeEntries vars = new LLVMDebuggerScopeEntries(getName());
    LLVMDispatchBasicBlockNode dispatchBlock = LLVMNode.getParent(node, LLVMDispatchBasicBlockNode.class);
    if (frame != null && dispatchBlock != null) {
        LocalVariableDebugInfo debugInfo = dispatchBlock.getDebugInfo();
        Map<LLVMSourceSymbol, Object> localVariables = debugInfo.getLocalVariables(frame, node);
        for (Map.Entry<LLVMSourceSymbol, Object> entry : localVariables.entrySet()) {
            LLVMSourceSymbol symbol = entry.getKey();
            if (symbols.contains(symbol)) {
                vars.add(symbol.getName(), entry.getValue());
            }
        }
    }
    for (LLVMSourceSymbol symbol : symbols) {
        if (!vars.contains(symbol.getName())) {
            LLVMDebugObjectBuilder dbgVal = sourceContext.getStatic(symbol);
            if (dbgVal == null) {
                dbgVal = LLVMDebugObjectBuilder.UNAVAILABLE;
            }
            vars.add(convertIdentifier(symbol.getName(), context), dbgVal.getValue(symbol));
        }
    }
    return vars;
}
Also used : LLVMDebugObjectBuilder(com.oracle.truffle.llvm.runtime.debug.value.LLVMDebugObjectBuilder) LocalVariableDebugInfo(com.oracle.truffle.llvm.runtime.types.symbols.LocalVariableDebugInfo) Map(java.util.Map) LLVMDispatchBasicBlockNode(com.oracle.truffle.llvm.runtime.nodes.control.LLVMDispatchBasicBlockNode) TruffleBoundary(com.oracle.truffle.api.CompilerDirectives.TruffleBoundary)

Example 2 with LLVMDispatchBasicBlockNode

use of com.oracle.truffle.llvm.runtime.nodes.control.LLVMDispatchBasicBlockNode in project graal by oracle.

the class BasicNodeFactory method createFunction.

@Override
public RootNode createFunction(int exceptionValueSlot, LLVMBasicBlockNode[] allFunctionNodes, UniquesRegion uniquesRegion, LLVMStatementNode[] copyArgumentsToFrame, FrameDescriptor frameDescriptor, int loopSuccessorSlot, LocalVariableDebugInfo debugInfo, String name, String originalName, int argumentCount, Source bcSource, LLVMSourceLocation location, LLVMFunction rootFunction) {
    LLVMUniquesRegionAllocNode uniquesRegionAllocNode = uniquesRegion.isEmpty() ? null : LLVMUniquesRegionAllocNodeGen.create(createAlloca(uniquesRegion.getSize(), uniquesRegion.getAlignment()));
    LLVMDispatchBasicBlockNode body = LLVMDispatchBasicBlockNodeGen.create(exceptionValueSlot, allFunctionNodes, loopSuccessorSlot, debugInfo);
    body.setSourceLocation(LLVMSourceLocation.orDefault(location));
    LLVMStackAccess stackAccess = createStackAccess();
    LLVMFunctionRootNode functionRoot = LLVMFunctionRootNodeGen.create(uniquesRegionAllocNode, stackAccess, copyArgumentsToFrame, body, frameDescriptor);
    functionRoot.setSourceLocation(LLVMSourceLocation.orDefault(location));
    return new LLVMFunctionStartNode(language, stackAccess, functionRoot, frameDescriptor, name, argumentCount, originalName, bcSource, location, dataLayout, rootFunction);
}
Also used : LLVMStackAccess(com.oracle.truffle.llvm.runtime.memory.LLVMStack.LLVMStackAccess) LLVMFunctionStartNode(com.oracle.truffle.llvm.runtime.nodes.func.LLVMFunctionStartNode) LLVMUniquesRegionAllocNode(com.oracle.truffle.llvm.runtime.memory.LLVMUniquesRegionAllocNode) LLVMFunctionRootNode(com.oracle.truffle.llvm.runtime.nodes.control.LLVMFunctionRootNode) LLVMDispatchBasicBlockNode(com.oracle.truffle.llvm.runtime.nodes.control.LLVMDispatchBasicBlockNode)

Aggregations

LLVMDispatchBasicBlockNode (com.oracle.truffle.llvm.runtime.nodes.control.LLVMDispatchBasicBlockNode)2 TruffleBoundary (com.oracle.truffle.api.CompilerDirectives.TruffleBoundary)1 LLVMDebugObjectBuilder (com.oracle.truffle.llvm.runtime.debug.value.LLVMDebugObjectBuilder)1 LLVMStackAccess (com.oracle.truffle.llvm.runtime.memory.LLVMStack.LLVMStackAccess)1 LLVMUniquesRegionAllocNode (com.oracle.truffle.llvm.runtime.memory.LLVMUniquesRegionAllocNode)1 LLVMFunctionRootNode (com.oracle.truffle.llvm.runtime.nodes.control.LLVMFunctionRootNode)1 LLVMFunctionStartNode (com.oracle.truffle.llvm.runtime.nodes.func.LLVMFunctionStartNode)1 LocalVariableDebugInfo (com.oracle.truffle.llvm.runtime.types.symbols.LocalVariableDebugInfo)1 Map (java.util.Map)1