boolean isInstrumentedFull(Set<Class<?>> providedTags, RootNode rootNode, Node node, SourceSection nodeSourceSection) { if (isInstrumentedLeaf(providedTags, node, nodeSourceSection)) { if (rootNode == null) { return false; } return isInstrumentedRoot(providedTags, rootNode, rootNode.getSourceSection(), 0); } return false; }
boolean isInstrumentedFull(Set<Class<?>> providedTags, RootNode rootNode, Node node, SourceSection nodeSourceSection) { if (isInstrumentedLeaf(providedTags, node, nodeSourceSection)) { if (rootNode == null) { return false; } return isInstrumentedRoot(providedTags, rootNode, rootNode.getSourceSection(), 0); } return false; }
properties.put("CodeSize", result.getTargetCodeSize()); properties.put("CodeAddress", "0x" + Long.toHexString(target.getCodeAddress())); properties.put("Source", formatSourceSection(target.getRootNode().getSourceSection()));
sourceSection = root.getSourceSection();
continue; } else { SourceSection sourceSection = root.getSourceSection(); if (RootNodeBits.isSameSource(rootBits) && sourceSection != null) { Source source = sourceSection.getSource();
continue; } else { SourceSection sourceSection = root.getSourceSection(); if (RootNodeBits.isSameSource(rootBits) && sourceSection != null) { Source source = sourceSection.getSource();
continue; } else { SourceSection sourceSection = root.getSourceSection(); if (RootNodeBits.isSameSource(rootBits) && sourceSection != null) { Source source = sourceSection.getSource();
continue; } else { SourceSection sourceSection = root.getSourceSection(); if (RootNodeBits.isSameSource(rootBits) && sourceSection != null) { Source source = sourceSection.getSource();
/** * Returns <code>true</code> if this root node should be considered internal and not be shown to * a guest language programmer. This method has effect on tools and guest language stack traces. * By default a {@link RootNode} is internal if no language was passed in the constructor or if * the {@link #getSourceSection() root source section} is set and points to an internal source. * This method is intended to be overwritten by guest languages, when the node's source is * internal, the implementation should respect that. Can be called on any thread and without a * language context. * * @since 0.27 */ public boolean isInternal() { if (getLanguageInfo() == null) { return true; } SourceSection sc = getSourceSection(); if (sc != null) { return sc.getSource().isInternal(); } return false; }
/** * Returns <code>true</code> if this root node should be considered internal and not be shown to * a guest language programmer. This method has effect on tools and guest language stack traces. * By default a {@link RootNode} is internal if no language was passed in the constructor or if * the {@link #getSourceSection() root source section} is set and points to an internal source. * This method is intended to be overwritten by guest languages, when the node's source is * internal, the implementation should respect that. Can be called on any thread and without a * language context. * * @since 0.27 */ public boolean isInternal() { if (getLanguageInfo() == null) { return true; } SourceSection sc = getSourceSection(); if (sc != null) { return sc.getSource().isInternal(); } return false; }
/** * Parent must match {@link #filterSourceSection} and child must match {@link #inputFilter}. */ boolean isChildInstrumentedFull(Set<Class<?>> providedTags, RootNode rootNode, Node parent, SourceSection parentSourceSection, Node current, SourceSection currentSourceSection) { if (inputFilter == null) { return false; } else if (rootNode == null) { return false; } else if (!InstrumentationHandler.isInstrumentableNode(parent, parentSourceSection)) { return false; } if (isInstrumentedLeaf(providedTags, parent, parentSourceSection) && inputFilter.isInstrumentedNode(providedTags, current, currentSourceSection)) { return isInstrumentedRoot(providedTags, rootNode, rootNode.getSourceSection(), 0); } return false; }
/** * Parent must match {@link #filterSourceSection} and child must match {@link #inputFilter}. */ boolean isChildInstrumentedFull(Set<Class<?>> providedTags, RootNode rootNode, Node parent, SourceSection parentSourceSection, Node current, SourceSection currentSourceSection) { if (inputFilter == null) { return false; } else if (rootNode == null) { return false; } else if (!InstrumentationHandler.isInstrumentableNode(parent, parentSourceSection)) { return false; } if (isInstrumentedLeaf(providedTags, parent, parentSourceSection) && inputFilter.isInstrumentedNode(providedTags, current, currentSourceSection)) { return isInstrumentedRoot(providedTags, rootNode, rootNode.getSourceSection(), 0); } return false; }
SourceSection sourceSection = root.getSourceSection(); if (sourceSection != null) { findSourcesVisitor.adoptSource(sourceSection.getSource());
SourceSection sourceSection = root.getSourceSection(); if (sourceSection != null) { findSourcesVisitor.adoptSource(sourceSection.getSource());
@SuppressWarnings("unchecked") boolean validEventContext() { Node node = getInstrumentedNode(); if (node instanceof RootNode) { throw new IllegalStateException("Instrumentable node must not be a root node."); } Object object = null; if (node instanceof InstrumentableNode) { object = ((InstrumentableNode) node).getNodeObject(); } else { // legacy support return true; } if (object != null) { assert AccessorInstrumentHandler.interopAccess().isValidNodeObject(object); } boolean foundStandardTag = false; for (Class<?> clazz : StandardTags.ALL_TAGS) { if (hasTag((Class<? extends Tag>) clazz)) { foundStandardTag = true; } } if (foundStandardTag) { RootNode root = probeNode.getRootNode(); if (root != null && root.getSourceSection() != null) { assert sourceSection != null : "All nodes tagged with a standard tag and with a root node that has a source section must also have a source section."; } } return true; }
@SuppressWarnings("unchecked") boolean validEventContext() { Node node = getInstrumentedNode(); if (node instanceof RootNode) { throw new IllegalStateException("Instrumentable node must not be a root node."); } Object object = null; if (node instanceof InstrumentableNode) { object = ((InstrumentableNode) node).getNodeObject(); } else { // legacy support return true; } if (object != null) { assert AccessorInstrumentHandler.interopAccess().isValidNodeObject(object); } boolean foundStandardTag = false; for (Class<?> clazz : StandardTags.ALL_TAGS) { if (hasTag((Class<? extends Tag>) clazz)) { foundStandardTag = true; } } if (foundStandardTag) { RootNode root = probeNode.getRootNode(); if (root != null && root.getSourceSection() != null) { assert sourceSection != null : "All nodes tagged with a standard tag and with a root node that has a source section must also have a source section."; } } return true; }
rootSources = null; } else { SourceSection sourceSection = root.getSourceSection(); if (RootNodeBits.isSameSource(rootBits) && sourceSection != null) { Source source = sourceSection.getSource();
@Override public org.graalvm.compiler.truffle.common.TruffleSourceLanguagePosition getPosition(JavaConstant node) { Node truffleNode = runtime().asObject(Node.class, node); if (truffleNode == null) { return null; } SourceSection section = null; if (truffleNode instanceof DirectCallNode) { section = ((DirectCallNode) truffleNode).getCurrentRootNode().getSourceSection(); } if (section == null) { section = truffleNode.getSourceSection(); } if (section == null) { Node cur = truffleNode.getParent(); while (cur != null) { section = cur.getSourceSection(); if (section != null) { break; } cur = cur.getParent(); } } if (section != null) { return new TruffleSourceLanguagePosition(section); } return null; }
private void visitRoot(RootNode root, final Node node, final AbstractNodeVisitor visitor, boolean forceRootBitComputation) { if (TRACE) { trace("BEGIN: Visit root %s for %s%n", root.toString(), visitor); } visitor.root = root; visitor.providedTags = getProvidedTags(root); visitor.rootSourceSection = root.getSourceSection(); visitor.rootBits = RootNodeBits.get(visitor.root); if (visitor.shouldVisit() || forceRootBitComputation) { if (forceRootBitComputation) { visitor.computingRootNodeBits = RootNodeBits.isUninitialized(visitor.rootBits) ? RootNodeBits.getAll() : visitor.rootBits; } else if (RootNodeBits.isUninitialized(visitor.rootBits)) { visitor.computingRootNodeBits = RootNodeBits.getAll(); } if (TRACE) { trace("BEGIN: Traverse root %s for %s%n", root.toString(), visitor); } visitor.visit(node); if (TRACE) { trace("END: Traverse root %s for %s%n", root.toString(), visitor); } if (!RootNodeBits.isUninitialized(visitor.computingRootNodeBits)) { RootNodeBits.set(visitor.root, visitor.computingRootNodeBits); } } if (TRACE) { trace("END: Visited root %s for %s%n", root.toString(), visitor); } }
private void visitRoot(RootNode root, final Node node, final AbstractNodeVisitor visitor, boolean forceRootBitComputation) { if (TRACE) { trace("BEGIN: Visit root %s for %s%n", root.toString(), visitor); } visitor.root = root; visitor.providedTags = getProvidedTags(root); visitor.rootSourceSection = root.getSourceSection(); visitor.rootBits = RootNodeBits.get(visitor.root); if (visitor.shouldVisit() || forceRootBitComputation) { if (forceRootBitComputation) { visitor.computingRootNodeBits = RootNodeBits.isUninitialized(visitor.rootBits) ? RootNodeBits.getAll() : visitor.rootBits; } else if (RootNodeBits.isUninitialized(visitor.rootBits)) { visitor.computingRootNodeBits = RootNodeBits.getAll(); } if (TRACE) { trace("BEGIN: Traverse root %s for %s%n", root.toString(), visitor); } visitor.visit(node); if (TRACE) { trace("END: Traverse root %s for %s%n", root.toString(), visitor); } if (!RootNodeBits.isUninitialized(visitor.computingRootNodeBits)) { RootNodeBits.set(visitor.root, visitor.computingRootNodeBits); } } if (TRACE) { trace("END: Visited root %s for %s%n", root.toString(), visitor); } }