Exemple #1
0
 /// <summary>
 ///     Constructs a new
 ///     <see cref="LookupSwitchInsnNode" />
 ///     .
 /// </summary>
 /// <param name="dflt">beginning of the default handler block.</param>
 /// <param name="keys">the values of the keys.</param>
 /// <param name="labels">
 ///     beginnings of the handler blocks.
 ///     <c>labels[i]</c>
 ///     is the beginning of the
 ///     handler block for the
 ///     <c>keys[i]</c>
 ///     key.
 /// </param>
 public LookupSwitchInsnNode(LabelNode dflt, int[] keys, LabelNode[] labels)
     : base(OpcodesConstants.Lookupswitch)
 {
     this.dflt   = dflt;
     this.keys   = Util.AsArrayList(keys);
     this.labels = Util.AsArrayList(labels);
 }
Exemple #2
0
 /// <summary>
 ///     Constructs a new
 ///     <see cref="TryCatchBlockNode" />
 ///     .
 /// </summary>
 /// <param name="start">the beginning of the exception handler's scope (inclusive).</param>
 /// <param name="end">the end of the exception handler's scope (exclusive).</param>
 /// <param name="handler">the beginning of the exception handler's code.</param>
 /// <param name="type">
 ///     the internal name of the type of exceptions handled by the handler, or
 ///     <literal>null</literal>
 ///     to catch any exceptions (for "finally" blocks).
 /// </param>
 public TryCatchBlockNode(LabelNode start, LabelNode end, LabelNode handler, string
                          type)
 {
     this.start   = start;
     this.end     = end;
     this.handler = handler;
     this.type    = type;
 }
Exemple #3
0
 /// <summary>
 ///     Constructs a new
 ///     <see cref="TableSwitchInsnNode" />
 ///     .
 /// </summary>
 /// <param name="min">the minimum key value.</param>
 /// <param name="max">the maximum key value.</param>
 /// <param name="dflt">beginning of the default handler block.</param>
 /// <param name="labels">
 ///     beginnings of the handler blocks.
 ///     <c>labels[i]</c>
 ///     is the beginning of the
 ///     handler block for the
 ///     <c>min + i</c>
 ///     key.
 /// </param>
 public TableSwitchInsnNode(int min, int max, LabelNode dflt, params LabelNode[] labels
                            )
     : base(OpcodesConstants.Tableswitch)
 {
     this.min    = min;
     this.max    = max;
     this.dflt   = dflt;
     this.labels = Util.AsArrayList(labels);
 }
Exemple #4
0
        private LabelNode[] GetLabelNodes(Label[] labels)
        {
            var labelNodes = new LabelNode[labels.Length];

            for (int i = 0, n = labels.Length; i < n; ++i)
            {
                labelNodes[i] = GetLabelNode(labels[i]);
            }
            return(labelNodes);
        }
Exemple #5
0
        /// <summary>Returns the clones of the given labels.</summary>
        /// <param name="labels">a list of labels.</param>
        /// <param name="clonedLabels">a map from LabelNodes to cloned LabelNodes.</param>
        /// <returns>the clones of the given labels.</returns>
        internal static LabelNode[] Clone(IList <LabelNode> labels, IDictionary <LabelNode,
                                                                                 LabelNode> clonedLabels)
        {
            var clones = new LabelNode[labels.Count];

            for (int i = 0, n = clones.Length; i < n; ++i)
            {
                clones[i] = clonedLabels.GetOrNull(labels[i]);
            }
            return(clones);
        }
Exemple #6
0
 /// <summary>Returns the clone of the given label.</summary>
 /// <param name="label">a label.</param>
 /// <param name="clonedLabels">a map from LabelNodes to cloned LabelNodes.</param>
 /// <returns>the clone of the given label.</returns>
 internal static LabelNode Clone(LabelNode label, IDictionary <LabelNode, LabelNode
                                                               > clonedLabels)
 {
     return(clonedLabels.GetOrNull(label));
 }
Exemple #7
0
 /// <summary>
 ///     Constructs a new
 ///     <see cref="LineNumberNode" />
 ///     .
 /// </summary>
 /// <param name="line">
 ///     a line number. This number refers to the source file from which the class was
 ///     compiled.
 /// </param>
 /// <param name="start">the first instruction corresponding to this line number.</param>
 public LineNumberNode(int line, LabelNode start)
     : base(-1)
 {
     this.line  = line;
     this.start = start;
 }
Exemple #8
0
 /// <summary>
 ///     Constructs a new
 ///     <see cref="JumpInsnNode" />
 ///     .
 /// </summary>
 /// <param name="opcode">
 ///     the opcode of the type instruction to be constructed. This opcode must be IFEQ,
 ///     IFNE, IFLT, IFGE, IFGT, IFLE, IF_ICMPEQ, IF_ICMPNE, IF_ICMPLT, IF_ICMPGE, IF_ICMPGT,
 ///     IF_ICMPLE, IF_ACMPEQ, IF_ACMPNE, GOTO, JSR, IFNULL or IFNONNULL.
 /// </param>
 /// <param name="label">
 ///     the operand of the instruction to be constructed. This operand is a label that
 ///     designates the instruction to which the jump instruction may jump.
 /// </param>
 public JumpInsnNode(int opcode, LabelNode label)
     : base(opcode)
 {
     this.label = label;
 }