|
| 1 | +/* |
| 2 | + * Scala (https://www.scala-lang.org) |
| 3 | + * |
| 4 | + * Copyright EPFL and Lightbend, Inc. |
| 5 | + * |
| 6 | + * Licensed under Apache License 2.0 |
| 7 | + * (http://www.apache.org/licenses/LICENSE-2.0). |
| 8 | + * |
| 9 | + * See the NOTICE file distributed with this work for |
| 10 | + * additional information regarding copyright ownership. |
| 11 | + */ |
| 12 | + |
| 13 | +package dotty.tools.backend.jvm; |
| 14 | + |
| 15 | +import scala.tools.asm.Label; |
| 16 | +import scala.tools.asm.Opcodes; |
| 17 | +import scala.tools.asm.tree.LabelNode; |
| 18 | +import scala.tools.asm.tree.MethodNode; |
| 19 | +/** |
| 20 | + * A subclass of {@link MethodNode} to customize the representation of |
| 21 | + * label nodes with {@link LabelNode1}. |
| 22 | + */ |
| 23 | +public class MethodNode1 extends MethodNode { |
| 24 | + public MethodNode1(int api, int access, String name, String descriptor, String signature, String[] exceptions) { |
| 25 | + super(api, access, name, descriptor, signature, exceptions); |
| 26 | + } |
| 27 | + |
| 28 | + public MethodNode1(int access, String name, String descriptor, String signature, String[] exceptions) { |
| 29 | + this(Opcodes.ASM6, access, name, descriptor, signature, exceptions); |
| 30 | + } |
| 31 | + |
| 32 | + public MethodNode1(int api) { |
| 33 | + super(api); |
| 34 | + } |
| 35 | + |
| 36 | + public MethodNode1() { |
| 37 | + this(Opcodes.ASM6); |
| 38 | + } |
| 39 | + |
| 40 | + @Override |
| 41 | + protected LabelNode getLabelNode(Label label) { |
| 42 | + if (!(label.info instanceof LabelNode)) { |
| 43 | + label.info = new LabelNode1(label); |
| 44 | + } |
| 45 | + return (LabelNode) label.info; |
| 46 | + } |
| 47 | +} |
0 commit comments