< prev index next >

src/java.base/share/classes/jdk/internal/org/objectweb/asm/tree/analysis/SourceInterpreter.java

Print this page
rev 47452 : imported patch jdk-new-asmv6.patch


  62 import java.util.List;
  63 import java.util.Set;
  64 
  65 import jdk.internal.org.objectweb.asm.Opcodes;
  66 import jdk.internal.org.objectweb.asm.Type;
  67 import jdk.internal.org.objectweb.asm.tree.AbstractInsnNode;
  68 import jdk.internal.org.objectweb.asm.tree.FieldInsnNode;
  69 import jdk.internal.org.objectweb.asm.tree.InvokeDynamicInsnNode;
  70 import jdk.internal.org.objectweb.asm.tree.LdcInsnNode;
  71 import jdk.internal.org.objectweb.asm.tree.MethodInsnNode;
  72 
  73 /**
  74  * An {@link Interpreter} for {@link SourceValue} values.
  75  *
  76  * @author Eric Bruneton
  77  */
  78 public class SourceInterpreter extends Interpreter<SourceValue> implements
  79         Opcodes {
  80 
  81     public SourceInterpreter() {
  82         super(ASM5);
  83     }
  84 
  85     protected SourceInterpreter(final int api) {
  86         super(api);
  87     }
  88 
  89     @Override
  90     public SourceValue newValue(final Type type) {
  91         if (type == Type.VOID_TYPE) {
  92             return null;
  93         }
  94         return new SourceValue(type == null ? 1 : type.getSize());
  95     }
  96 
  97     @Override
  98     public SourceValue newOperation(final AbstractInsnNode insn) {
  99         int size;
 100         switch (insn.getOpcode()) {
 101         case LCONST_0:
 102         case LCONST_1:




  62 import java.util.List;
  63 import java.util.Set;
  64 
  65 import jdk.internal.org.objectweb.asm.Opcodes;
  66 import jdk.internal.org.objectweb.asm.Type;
  67 import jdk.internal.org.objectweb.asm.tree.AbstractInsnNode;
  68 import jdk.internal.org.objectweb.asm.tree.FieldInsnNode;
  69 import jdk.internal.org.objectweb.asm.tree.InvokeDynamicInsnNode;
  70 import jdk.internal.org.objectweb.asm.tree.LdcInsnNode;
  71 import jdk.internal.org.objectweb.asm.tree.MethodInsnNode;
  72 
  73 /**
  74  * An {@link Interpreter} for {@link SourceValue} values.
  75  *
  76  * @author Eric Bruneton
  77  */
  78 public class SourceInterpreter extends Interpreter<SourceValue> implements
  79         Opcodes {
  80 
  81     public SourceInterpreter() {
  82         super(ASM6);
  83     }
  84 
  85     protected SourceInterpreter(final int api) {
  86         super(api);
  87     }
  88 
  89     @Override
  90     public SourceValue newValue(final Type type) {
  91         if (type == Type.VOID_TYPE) {
  92             return null;
  93         }
  94         return new SourceValue(type == null ? 1 : type.getSize());
  95     }
  96 
  97     @Override
  98     public SourceValue newOperation(final AbstractInsnNode insn) {
  99         int size;
 100         switch (insn.getOpcode()) {
 101         case LCONST_0:
 102         case LCONST_1:


< prev index next >