src/java.base/share/classes/jdk/experimental/bytecode/CodeBuilder.java

Print this page




1241         if (t == null) {
1242             stackmaps.writeByte(0);
1243         } else {
1244             switch (typeHelper.tag(t)) {
1245                 case B:
1246                 case C:
1247                 case S:
1248                 case I:
1249                 case Z:
1250                     stackmaps.writeByte(1);
1251                     break;
1252                 case F:
1253                     stackmaps.writeByte(2);
1254                     break;
1255                 case D:
1256                     stackmaps.writeByte(3);
1257                     break;
1258                 case J:
1259                     stackmaps.writeByte(4);
1260                     break;

1261                 case A:
1262                     if (t == typeHelper.nullType()) {
1263                         stackmaps.writeByte(5); //null
1264                     } else {
1265                         //TODO: uninit this, top?
1266                         stackmaps.writeByte(7);
1267                         stackmaps.writeChar(poolHelper.putClass(typeHelper.symbol(t)));
1268                     }
1269                     break;
1270                 default:
1271                     throw new IllegalStateException("Bad type");
1272             }
1273         }
1274     }
1275 
1276     public void sameFrame(int offsetDelta) {
1277         int frameType = (offsetDelta < SAME_FRAME_SIZE) ?
1278                 offsetDelta : SAME_FRAME_EXTENDED;
1279         stackmaps.writeByte(frameType);
1280         if (frameType == SAME_FRAME_EXTENDED) {




1241         if (t == null) {
1242             stackmaps.writeByte(0);
1243         } else {
1244             switch (typeHelper.tag(t)) {
1245                 case B:
1246                 case C:
1247                 case S:
1248                 case I:
1249                 case Z:
1250                     stackmaps.writeByte(1);
1251                     break;
1252                 case F:
1253                     stackmaps.writeByte(2);
1254                     break;
1255                 case D:
1256                     stackmaps.writeByte(3);
1257                     break;
1258                 case J:
1259                     stackmaps.writeByte(4);
1260                     break;
1261                 case Q:
1262                 case A:
1263                     if (t == typeHelper.nullType()) {
1264                         stackmaps.writeByte(5); //null
1265                     } else {
1266                         //TODO: uninit this, top?
1267                         stackmaps.writeByte(7);
1268                         stackmaps.writeChar(poolHelper.putClass(typeHelper.symbol(t)));
1269                     }
1270                     break;
1271                 default:
1272                     throw new IllegalStateException("Bad type");
1273             }
1274         }
1275     }
1276 
1277     public void sameFrame(int offsetDelta) {
1278         int frameType = (offsetDelta < SAME_FRAME_SIZE) ?
1279                 offsetDelta : SAME_FRAME_EXTENDED;
1280         stackmaps.writeByte(frameType);
1281         if (frameType == SAME_FRAME_EXTENDED) {