< prev index next >

src/java.base/share/classes/jdk/internal/org/objectweb/asm/Frame.java

Print this page

 343       */
 344     private static int getAbstractTypeFromDescriptor(
 345             final SymbolTable symbolTable, final String buffer, final int offset) {
 346         String internalName;
 347         switch (buffer.charAt(offset)) {
 348             case 'V':
 349                 return 0;
 350             case 'Z':
 351             case 'C':
 352             case 'B':
 353             case 'S':
 354             case 'I':
 355                 return INTEGER;
 356             case 'F':
 357                 return FLOAT;
 358             case 'J':
 359                 return LONG;
 360             case 'D':
 361                 return DOUBLE;
 362             case 'L':

 363                 internalName = buffer.substring(offset + 1, buffer.length() - 1);
 364                 return REFERENCE_KIND | symbolTable.addType(internalName);
 365             case '[':
 366                 int elementDescriptorOffset = offset + 1;
 367                 while (buffer.charAt(elementDescriptorOffset) == '[') {
 368                     ++elementDescriptorOffset;
 369                 }
 370                 int typeValue;
 371                 switch (buffer.charAt(elementDescriptorOffset)) {
 372                     case 'Z':
 373                         typeValue = BOOLEAN;
 374                         break;
 375                     case 'C':
 376                         typeValue = CHAR;
 377                         break;
 378                     case 'B':
 379                         typeValue = BYTE;
 380                         break;
 381                     case 'S':
 382                         typeValue = SHORT;
 383                         break;
 384                     case 'I':
 385                         typeValue = INTEGER;
 386                         break;
 387                     case 'F':
 388                         typeValue = FLOAT;
 389                         break;
 390                     case 'J':
 391                         typeValue = LONG;
 392                         break;
 393                     case 'D':
 394                         typeValue = DOUBLE;
 395                         break;
 396                     case 'L':

 397                         internalName = buffer.substring(elementDescriptorOffset + 1, buffer.length() - 1);
 398                         typeValue = REFERENCE_KIND | symbolTable.addType(internalName);
 399                         break;
 400                     default:
 401                         throw new IllegalArgumentException();
 402                 }
 403                 return ((elementDescriptorOffset - offset) << DIM_SHIFT) | typeValue;
 404             default:
 405                 throw new IllegalArgumentException();
 406         }
 407     }
 408 
 409     // -----------------------------------------------------------------------------------------------
 410     // Methods related to the input frame
 411     // -----------------------------------------------------------------------------------------------
 412 
 413     /**
 414       * Sets the input frame from the given method description. This method is used to initialize the
 415       * first frame of a method, which is implicit (i.e. not stored explicitly in the StackMapTable
 416       * attribute).

 343       */
 344     private static int getAbstractTypeFromDescriptor(
 345             final SymbolTable symbolTable, final String buffer, final int offset) {
 346         String internalName;
 347         switch (buffer.charAt(offset)) {
 348             case 'V':
 349                 return 0;
 350             case 'Z':
 351             case 'C':
 352             case 'B':
 353             case 'S':
 354             case 'I':
 355                 return INTEGER;
 356             case 'F':
 357                 return FLOAT;
 358             case 'J':
 359                 return LONG;
 360             case 'D':
 361                 return DOUBLE;
 362             case 'L':
 363             case 'Q':
 364                 internalName = buffer.substring(offset + 1, buffer.length() - 1);
 365                 return REFERENCE_KIND | symbolTable.addType(internalName);
 366             case '[':
 367                 int elementDescriptorOffset = offset + 1;
 368                 while (buffer.charAt(elementDescriptorOffset) == '[') {
 369                     ++elementDescriptorOffset;
 370                 }
 371                 int typeValue;
 372                 switch (buffer.charAt(elementDescriptorOffset)) {
 373                     case 'Z':
 374                         typeValue = BOOLEAN;
 375                         break;
 376                     case 'C':
 377                         typeValue = CHAR;
 378                         break;
 379                     case 'B':
 380                         typeValue = BYTE;
 381                         break;
 382                     case 'S':
 383                         typeValue = SHORT;
 384                         break;
 385                     case 'I':
 386                         typeValue = INTEGER;
 387                         break;
 388                     case 'F':
 389                         typeValue = FLOAT;
 390                         break;
 391                     case 'J':
 392                         typeValue = LONG;
 393                         break;
 394                     case 'D':
 395                         typeValue = DOUBLE;
 396                         break;
 397                     case 'L':
 398                     case 'Q':
 399                         internalName = buffer.substring(elementDescriptorOffset + 1, buffer.length() - 1);
 400                         typeValue = REFERENCE_KIND | symbolTable.addType(internalName);
 401                         break;
 402                     default:
 403                         throw new IllegalArgumentException();
 404                 }
 405                 return ((elementDescriptorOffset - offset) << DIM_SHIFT) | typeValue;
 406             default:
 407                 throw new IllegalArgumentException();
 408         }
 409     }
 410 
 411     // -----------------------------------------------------------------------------------------------
 412     // Methods related to the input frame
 413     // -----------------------------------------------------------------------------------------------
 414 
 415     /**
 416       * Sets the input frame from the given method description. This method is used to initialize the
 417       * first frame of a method, which is implicit (i.e. not stored explicitly in the StackMapTable
 418       * attribute).
< prev index next >