< prev index next >

test/jdk/lib/testlibrary/bytecode/jdk/experimental/bytecode/MacroCodeBuilder.java

Print this page
*** 113,44 ***
      public MacroCodeBuilder(MethodBuilder<S, T, E> methodBuilder) {
          super(methodBuilder);
      }
  
      public C load(TypeTag type, int n) {
!         if (type == TypeTag.Q) {
!             return vload(n);
!         } else {
!             switch (n) {
!                 case 0:
!                     return emitOp(Opcode.ILOAD_0.at(type, 4));
!                 case 1:
!                     return emitOp(Opcode.ILOAD_1.at(type, 4));
!                 case 2:
!                     return emitOp(Opcode.ILOAD_2.at(type, 4));
!                 case 3:
-                     return emitOp(Opcode.ILOAD_3.at(type, 4));
-                 default:
-                     return emitWideIfNeeded(Opcode.ILOAD.at(type), n);
-             }
          }
      }
  
      public C store(TypeTag type, int n) {
!         if (type == TypeTag.Q) {
!             return vstore(n);
!         } else {
!             switch (n) {
!                 case 0:
!                     return emitOp(Opcode.ISTORE_0.at(type, 4));
!                 case 1:
!                     return emitOp(Opcode.ISTORE_1.at(type, 4));
!                 case 2:
!                     return emitOp(Opcode.ISTORE_2.at(type, 4));
!                 case 3:
-                     return emitOp(Opcode.ISTORE_3.at(type, 4));
-                 default:
-                     return emitWideIfNeeded(Opcode.ISTORE.at(type), n);
-             }
          }
      }
  
      public C arrayload(TypeTag type) {
          return emitOp(Opcode.IALOAD.at(type));
--- 113,36 ---
      public MacroCodeBuilder(MethodBuilder<S, T, E> methodBuilder) {
          super(methodBuilder);
      }
  
      public C load(TypeTag type, int n) {
!         switch (n) {
!             case 0:
!                 return emitOp(Opcode.ILOAD_0.at(type, 4));
!             case 1:
!                 return emitOp(Opcode.ILOAD_1.at(type, 4));
!             case 2:
!                 return emitOp(Opcode.ILOAD_2.at(type, 4));
!             case 3:
!                 return emitOp(Opcode.ILOAD_3.at(type, 4));
!             default:
!                 return emitWideIfNeeded(Opcode.ILOAD.at(type), n);
          }
      }
  
      public C store(TypeTag type, int n) {
!         switch (n) {
!             case 0:
!                 return emitOp(Opcode.ISTORE_0.at(type, 4));
!             case 1:
!                 return emitOp(Opcode.ISTORE_1.at(type, 4));
!             case 2:
!                 return emitOp(Opcode.ISTORE_2.at(type, 4));
!             case 3:
!                 return emitOp(Opcode.ISTORE_3.at(type, 4));
!             default:
!                 return emitWideIfNeeded(Opcode.ISTORE.at(type), n);
          }
      }
  
      public C arrayload(TypeTag type) {
          return emitOp(Opcode.IALOAD.at(type));

*** 306,33 ***
      }
  
      public C return_(TypeTag type) {
          switch (type) {
              case V:
-                 return return_();
              case Q:
!                 return vreturn();
              default:
                  return emitOp(Opcode.IRETURN.at(type));
          }
      }
  
-     @Override
-     public LabelledTypedBuilder typed(TypeTag typeTag) {
-         return super.typed(typeTag, _unused -> new LabelledTypedBuilder());
-     }
- 
-     public class LabelledTypedBuilder extends TypedBuilder {
-         public C if_acmpeq(CharSequence target) {
-             return ifcmp(TypeTag.A, CondKind.EQ, target);
-         }
- 
-         public C if_acmpne(CharSequence target) {
-             return ifcmp(TypeTag.A, CondKind.NE, target);
-         }
-     }
- 
      public C conv(TypeTag from, TypeTag to) {
          switch (from) {
              case B:
              case C:
              case S:
--- 298,17 ---
      }
  
      public C return_(TypeTag type) {
          switch (type) {
              case V:
              case Q:
!                 return return_();
              default:
                  return emitOp(Opcode.IRETURN.at(type));
          }
      }
  
      public C conv(TypeTag from, TypeTag to) {
          switch (from) {
              case B:
              case C:
              case S:
< prev index next >