当前位置: 首页>>代码示例>>Java>>正文


Java Frame.getStackSize方法代码示例

本文整理汇总了Java中jdk.internal.org.objectweb.asm.tree.analysis.Frame.getStackSize方法的典型用法代码示例。如果您正苦于以下问题:Java Frame.getStackSize方法的具体用法?Java Frame.getStackSize怎么用?Java Frame.getStackSize使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在jdk.internal.org.objectweb.asm.tree.analysis.Frame的用法示例。


在下文中一共展示了Frame.getStackSize方法的3个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。

示例1: printAnalyzerResult

import jdk.internal.org.objectweb.asm.tree.analysis.Frame; //导入方法依赖的package包/类
static void printAnalyzerResult(MethodNode method, Analyzer<BasicValue> a,
        final PrintWriter pw) {
    Frame<BasicValue>[] frames = a.getFrames();
    Textifier t = new Textifier();
    TraceMethodVisitor mv = new TraceMethodVisitor(t);

    pw.println(method.name + method.desc);
    for (int j = 0; j < method.instructions.size(); ++j) {
        method.instructions.get(j).accept(mv);

        StringBuilder sb = new StringBuilder();
        Frame<BasicValue> f = frames[j];
        if (f == null) {
            sb.append('?');
        } else {
            for (int k = 0; k < f.getLocals(); ++k) {
                sb.append(getShortName(f.getLocal(k).toString()))
                        .append(' ');
            }
            sb.append(" : ");
            for (int k = 0; k < f.getStackSize(); ++k) {
                sb.append(getShortName(f.getStack(k).toString()))
                        .append(' ');
            }
        }
        while (sb.length() < method.maxStack + method.maxLocals + 1) {
            sb.append(' ');
        }
        pw.print(Integer.toString(j + 100000).substring(1));
        pw.print(" " + sb + " : " + t.text.get(t.text.size() - 1));
    }
    for (int j = 0; j < method.tryCatchBlocks.size(); ++j) {
        method.tryCatchBlocks.get(j).accept(mv);
        pw.print(" " + t.text.get(t.text.size() - 1));
    }
    pw.println();
}
 
开发者ID:SunburstApps,项目名称:OpenJSharp,代码行数:38,代码来源:CheckClassAdapter.java

示例2: printAnalyzerResult

import jdk.internal.org.objectweb.asm.tree.analysis.Frame; //导入方法依赖的package包/类
static void printAnalyzerResult(MethodNode method, Analyzer<BasicValue> a,
        final PrintWriter pw) {
    Frame<BasicValue>[] frames = a.getFrames();
    Textifier t = new Textifier();
    TraceMethodVisitor mv = new TraceMethodVisitor(t);

    pw.println(method.name + method.desc);
    for (int j = 0; j < method.instructions.size(); ++j) {
        method.instructions.get(j).accept(mv);

        StringBuffer s = new StringBuffer();
        Frame<BasicValue> f = frames[j];
        if (f == null) {
            s.append('?');
        } else {
            for (int k = 0; k < f.getLocals(); ++k) {
                s.append(getShortName(f.getLocal(k).toString()))
                        .append(' ');
            }
            s.append(" : ");
            for (int k = 0; k < f.getStackSize(); ++k) {
                s.append(getShortName(f.getStack(k).toString()))
                        .append(' ');
            }
        }
        while (s.length() < method.maxStack + method.maxLocals + 1) {
            s.append(' ');
        }
        pw.print(Integer.toString(j + 100000).substring(1));
        pw.print(" " + s + " : " + t.text.get(t.text.size() - 1));
    }
    for (int j = 0; j < method.tryCatchBlocks.size(); ++j) {
        method.tryCatchBlocks.get(j).accept(mv);
        pw.print(" " + t.text.get(t.text.size() - 1));
    }
    pw.println();
}
 
开发者ID:RedlineResearch,项目名称:OLD-OpenJDK8,代码行数:38,代码来源:CheckClassAdapter.java

示例3: printAnalyzerResult

import jdk.internal.org.objectweb.asm.tree.analysis.Frame; //导入方法依赖的package包/类
static void printAnalyzerResult(
    MethodNode method,
    Analyzer<BasicValue> a,
    final PrintWriter pw)
{
    Frame<BasicValue>[] frames = a.getFrames();
    Textifier t = new Textifier();
    TraceMethodVisitor mv = new TraceMethodVisitor(t);

    pw.println(method.name + method.desc);
    for (int j = 0; j < method.instructions.size(); ++j) {
        method.instructions.get(j).accept(mv);

        StringBuffer s = new StringBuffer();
        Frame<BasicValue> f = frames[j];
        if (f == null) {
            s.append('?');
        } else {
            for (int k = 0; k < f.getLocals(); ++k) {
                s.append(getShortName(f.getLocal(k).toString()))
                        .append(' ');
            }
            s.append(" : ");
            for (int k = 0; k < f.getStackSize(); ++k) {
                s.append(getShortName(f.getStack(k).toString()))
                        .append(' ');
            }
        }
        while (s.length() < method.maxStack + method.maxLocals + 1) {
            s.append(' ');
        }
        pw.print(Integer.toString(j + 100000).substring(1));
        pw.print(" " + s + " : " + t.text.get(t.text.size() - 1));
    }
    for (int j = 0; j < method.tryCatchBlocks.size(); ++j) {
        method.tryCatchBlocks.get(j).accept(mv);
        pw.print(" " + t.text.get(t.text.size() - 1));
    }
    pw.println();
}
 
开发者ID:wro4j,项目名称:nashorn-backport,代码行数:41,代码来源:CheckClassAdapter.java


注:本文中的jdk.internal.org.objectweb.asm.tree.analysis.Frame.getStackSize方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。