Example #1
0
 public PythonWrapperNode(PythonContext context, PNode child) {
   /**
    * Don't insert the child here, because child node will be replaced with the wrapper node. If
    * child node is inserted here, it's parent (which will be wrapper's parent after replacement)
    * will be lost. Instead, wrapper is created, and the child is replaced with its wrapper, and
    * then wrapper's child is adopted by calling adoptChildren() in {@link ProfilerTranslator}.
    */
   this.child = child;
   /**
    * context.getProbe will either generate a probe for this source section, or return the existing
    * probe for this section. There can be only one probe for the same source section.
    */
   this.probe = context.createProbe(child.getSourceSection());
 }
Example #2
0
  @Override
  public PEnumerate executePEnumerate(VirtualFrame frame) throws UnexpectedResultException {
    probe.enter(child, frame);
    PEnumerate result;

    try {
      result = child.executePEnumerate(frame);
    } catch (KillException e) {
      throw (e);
    } catch (Exception e) {
      probe.leaveExceptional(child, frame, e);
      throw (e);
    }

    return result;
  }
Example #3
0
  @Override
  public int executeInt(VirtualFrame frame) throws UnexpectedResultException {
    probe.enter(child, frame);
    int result;

    try {
      result = child.executeInt(frame);
      probe.leave(child, frame);
    } catch (KillException e) {
      throw (e);
    } catch (Exception e) {
      probe.leaveExceptional(child, frame, e);
      throw (e);
    }

    return result;
  }
Example #4
0
  @Override
  public Object execute(VirtualFrame frame) {
    probe.enter(child, frame);
    Object result;

    try {
      result = child.execute(frame);
      probe.leave(child, frame);
    } catch (KillException e) {
      throw (e);
    } catch (Exception e) {
      probe.leaveExceptional(child, frame, e);
      throw (e);
    }

    return result;
  }
Example #5
0
  @Override
  public PSequenceIterator executePSequenceIterator(VirtualFrame frame)
      throws UnexpectedResultException {
    probe.enter(child, frame);
    PSequenceIterator result;

    try {
      result = child.executePSequenceIterator(frame);
      probe.leave(child, frame);
    } catch (KillException e) {
      throw (e);
    } catch (Exception e) {
      probe.leaveExceptional(child, frame, e);
      throw (e);
    }

    return result;
  }
Example #6
0
  @Override
  public PythonBuiltinClass executePythonBuiltinClass(VirtualFrame frame)
      throws UnexpectedResultException {
    probe.enter(child, frame);
    PythonBuiltinClass result;

    try {
      result = child.executePythonBuiltinClass(frame);
      probe.leave(child, frame);
    } catch (KillException e) {
      throw (e);
    } catch (Exception e) {
      probe.leaveExceptional(child, frame, e);
      throw (e);
    }

    return result;
  }