gpt4 book ai didi

net.sf.saxon.expr.XPathContextMajor.resetStackFrameMap()方法的使用及代码示例

转载 作者:知者 更新时间:2024-03-20 19:47:40 25 4
gpt4 key购买 nike

本文整理了Java中net.sf.saxon.expr.XPathContextMajor.resetStackFrameMap()方法的一些代码示例,展示了XPathContextMajor.resetStackFrameMap()的具体用法。这些代码示例主要来源于Github/Stackoverflow/Maven等平台,是从一些精选项目中提取出来的代码,具有较强的参考意义,能在一定程度帮忙到你。XPathContextMajor.resetStackFrameMap()方法的具体详情如下:
包路径:net.sf.saxon.expr.XPathContextMajor
类名称:XPathContextMajor
方法名:resetStackFrameMap

XPathContextMajor.resetStackFrameMap介绍

[英]Reset the stack frame variable map, while reusing the StackFrame object itself. This is done on a tail call to a different function
[中]重置stack frame变量映射,同时重用StackFrame对象本身。这是在对不同函数的尾部调用上完成的

代码示例

代码示例来源:origin: net.sourceforge.saxon/saxon

/**
 * Make a tail call on a different function. This reuses the context object and the stack frame array
 * where possible, but it does consume some Java stack space. It's still worth it, because we don't use
 * as much stack as we would if we didn't return down to the TailCallLoop level.
 * @param fn the function to be called
 * @param cm the dynamic context
 * @return the result of calling the other function
 * @throws XPathException if the called function fails
 */
private ValueRepresentation tailCallDifferentFunction(UserFunction fn, XPathContextMajor cm) throws XPathException {
  cm.resetStackFrameMap(fn.getStackFrameMap(), fn.getNumberOfArguments());
  try {
    return ExpressionTool.evaluate(fn.getBody(), fn.getEvaluationMode(), cm, 1);
  } catch (XPathException err) {
    err.maybeSetLocation(this);
    err.maybeSetContext(cm);
    throw err;
  }
}

代码示例来源:origin: org.opengis.cite.saxon/saxon9

/**
 * Make a tail call on a different function. This reuses the context object and the stack frame array
 * where possible, but it does consume some Java stack space. It's still worth it, because we don't use
 * as much stack as we would if we didn't return down to the TailCallLoop level.
 * @param fn the function to be called
 * @param cm the dynamic context
 * @return the result of calling the other function
 * @throws XPathException if the called function fails
 */
private ValueRepresentation tailCallDifferentFunction(UserFunction fn, XPathContextMajor cm) throws XPathException {
  cm.resetStackFrameMap(fn.getStackFrameMap(), fn.getNumberOfArguments());
  try {
    return ExpressionTool.evaluate(fn.getBody(), fn.getEvaluationMode(), cm, 1);
  } catch (XPathException err) {
    err.maybeSetLocation(this);
    err.maybeSetContext(cm);
    throw err;
  }
}

代码示例来源:origin: net.sf.saxon/Saxon-HE

/**
 * Make a tail call on a different function. This reuses the context object and the stack frame array
 * where possible, but it does consume some Java stack space. It's still worth it, because we don't use
 * as much stack as we would if we didn't return down to the TailCallLoop level.
 *
 * @param userFunction the function to be called
 * @param cm the dynamic context
 * @return the result of calling the other function
 * @throws XPathException if the called function fails
 */
/*@Nullable*/
private Sequence<?> tailCallDifferentFunction(UserFunction userFunction, XPathContextMajor cm) throws XPathException {
  cm.resetStackFrameMap(userFunction.getStackFrameMap(), userFunction.getArity());
  try {
    return userFunction.getEvaluator().evaluate(userFunction.getBody(), cm);
  } catch (XPathException err) {
    err.maybeSetLocation(getLocation());
    err.maybeSetContext(cm);
    throw err;
  }
}

代码示例来源:origin: org.apache.servicemix.bundles/org.apache.servicemix.bundles.saxon

/**
 * Make a tail call on a different function. This reuses the context object and the stack frame array
 * where possible, but it does consume some Java stack space. It's still worth it, because we don't use
 * as much stack as we would if we didn't return down to the TailCallLoop level.
 *
 * @param userFunction the function to be called
 * @param cm the dynamic context
 * @return the result of calling the other function
 * @throws XPathException if the called function fails
 */
/*@Nullable*/
private Sequence<?> tailCallDifferentFunction(UserFunction userFunction, XPathContextMajor cm) throws XPathException {
  cm.resetStackFrameMap(userFunction.getStackFrameMap(), userFunction.getArity());
  try {
    return userFunction.getEvaluator().evaluate(userFunction.getBody(), cm);
  } catch (XPathException err) {
    err.maybeSetLocation(getLocation());
    err.maybeSetContext(cm);
    throw err;
  }
}

25 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com