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