39 import com.sun.tools.classfile.ConstantValue_attribute; |
39 import com.sun.tools.classfile.ConstantValue_attribute; |
40 import com.sun.tools.classfile.DefaultAttribute; |
40 import com.sun.tools.classfile.DefaultAttribute; |
41 import com.sun.tools.classfile.Deprecated_attribute; |
41 import com.sun.tools.classfile.Deprecated_attribute; |
42 import com.sun.tools.classfile.EnclosingMethod_attribute; |
42 import com.sun.tools.classfile.EnclosingMethod_attribute; |
43 import com.sun.tools.classfile.Exceptions_attribute; |
43 import com.sun.tools.classfile.Exceptions_attribute; |
44 import com.sun.tools.classfile.Field; |
|
45 import com.sun.tools.classfile.InnerClasses_attribute; |
44 import com.sun.tools.classfile.InnerClasses_attribute; |
46 import com.sun.tools.classfile.LineNumberTable_attribute; |
45 import com.sun.tools.classfile.LineNumberTable_attribute; |
47 import com.sun.tools.classfile.LocalVariableTable_attribute; |
46 import com.sun.tools.classfile.LocalVariableTable_attribute; |
48 import com.sun.tools.classfile.LocalVariableTypeTable_attribute; |
47 import com.sun.tools.classfile.LocalVariableTypeTable_attribute; |
49 import com.sun.tools.classfile.ModuleExportTable_attribute; |
48 import com.sun.tools.classfile.ModuleExportTable_attribute; |
147 println(); |
146 println(); |
148 return null; |
147 return null; |
149 } |
148 } |
150 |
149 |
151 public Void visitAnnotationDefault(AnnotationDefault_attribute attr, Void ignore) { |
150 public Void visitAnnotationDefault(AnnotationDefault_attribute attr, Void ignore) { |
152 println(" AnnotationDefault: "); |
151 println("AnnotationDefault:"); |
153 print(" default_value: "); |
152 indent(+1); |
|
153 print("default_value: "); |
154 annotationWriter.write(attr.default_value); |
154 annotationWriter.write(attr.default_value); |
|
155 indent(-1); |
155 return null; |
156 return null; |
156 } |
157 } |
157 |
158 |
158 public Void visitCharacterRangeTable(CharacterRangeTable_attribute attr, Void ignore) { |
159 public Void visitCharacterRangeTable(CharacterRangeTable_attribute attr, Void ignore) { |
159 print(" CharacterRangeTable: "); |
160 println("CharacterRangeTable:"); |
|
161 indent(+1); |
160 for (int i = 0; i < attr.character_range_table.length; i++) { |
162 for (int i = 0; i < attr.character_range_table.length; i++) { |
161 CharacterRangeTable_attribute.Entry e = attr.character_range_table[i]; |
163 CharacterRangeTable_attribute.Entry e = attr.character_range_table[i]; |
162 print(" " + e.start_pc + ", " + |
164 print(" " + e.start_pc + ", " + |
163 e.end_pc + ", " + |
165 e.end_pc + ", " + |
164 Integer.toHexString(e.character_range_start) + ", " + |
166 Integer.toHexString(e.character_range_start) + ", " + |
165 Integer.toHexString(e.character_range_end) + ", " + |
167 Integer.toHexString(e.character_range_end) + ", " + |
166 Integer.toHexString(e.flags) + |
168 Integer.toHexString(e.flags)); |
167 "\t// "); |
169 tab(); |
|
170 print("// "); |
168 print(e.start_pc + ", " + |
171 print(e.start_pc + ", " + |
169 e.end_pc + ", " + |
172 e.end_pc + ", " + |
170 (e.character_range_start >> 10) + ":" + (e.character_range_start & 0x3ff) + ", " + |
173 (e.character_range_start >> 10) + ":" + (e.character_range_start & 0x3ff) + ", " + |
171 (e.character_range_end >> 10) + ":" + (e.character_range_end & 0x3ff)); |
174 (e.character_range_end >> 10) + ":" + (e.character_range_end & 0x3ff)); |
172 if ((e.flags & CharacterRangeTable_attribute.CRT_STATEMENT) != 0) |
175 if ((e.flags & CharacterRangeTable_attribute.CRT_STATEMENT) != 0) |
185 print(", create"); |
188 print(", create"); |
186 if ((e.flags & CharacterRangeTable_attribute.CRT_BRANCH_TRUE) != 0) |
189 if ((e.flags & CharacterRangeTable_attribute.CRT_BRANCH_TRUE) != 0) |
187 print(", branch-true"); |
190 print(", branch-true"); |
188 if ((e.flags & CharacterRangeTable_attribute.CRT_BRANCH_FALSE) != 0) |
191 if ((e.flags & CharacterRangeTable_attribute.CRT_BRANCH_FALSE) != 0) |
189 print(", branch-false"); |
192 print(", branch-false"); |
190 |
193 } |
191 |
194 indent(-1); |
192 |
|
193 } |
|
194 return null; |
195 return null; |
195 } |
196 } |
196 |
197 |
197 public Void visitCode(Code_attribute attr, Void ignore) { |
198 public Void visitCode(Code_attribute attr, Void ignore) { |
198 codeWriter.write(attr, constant_pool); |
199 codeWriter.write(attr, constant_pool); |
199 println(); |
|
200 return null; |
200 return null; |
201 } |
201 } |
202 |
202 |
203 public Void visitCompilationID(CompilationID_attribute attr, Void ignore) { |
203 public Void visitCompilationID(CompilationID_attribute attr, Void ignore) { |
204 constantWriter.write(attr.compilationID_index); |
204 constantWriter.write(attr.compilationID_index); |
205 return null; |
205 return null; |
206 } |
206 } |
207 |
207 |
208 public Void visitConstantValue(ConstantValue_attribute attr, Void ignore) { |
208 public Void visitConstantValue(ConstantValue_attribute attr, Void ignore) { |
209 if (options.compat) // BUG 6622216 javap names some attributes incorrectly |
209 if (options.compat) // BUG 6622216 javap names some attributes incorrectly |
210 print(" Constant value: "); |
210 print("Constant value: "); |
211 else |
211 else |
212 print(" ConstantValue: "); |
212 print("ConstantValue: "); |
213 constantWriter.write(attr.constantvalue_index); |
213 constantWriter.write(attr.constantvalue_index); |
214 if (!options.compat) // BUG 6622232 javap gets whitespace confused |
214 println(); |
215 println(); |
|
216 return null; |
215 return null; |
217 } |
216 } |
218 |
217 |
219 public Void visitDeprecated(Deprecated_attribute attr, Void ignore) { |
218 public Void visitDeprecated(Deprecated_attribute attr, Void ignore) { |
220 if (!(options.compat && owner instanceof Field)) // BUG 6622232 javap gets whitespace confused |
|
221 print(" "); |
|
222 println("Deprecated: true"); |
219 println("Deprecated: true"); |
223 return null; |
220 return null; |
224 } |
221 } |
225 |
222 |
226 public Void visitEnclosingMethod(EnclosingMethod_attribute attr, Void ignore) { |
223 public Void visitEnclosingMethod(EnclosingMethod_attribute attr, Void ignore) { |
227 print(" EnclosingMethod: #" + attr.class_index + ".#" + attr.method_index |
224 print("EnclosingMethod: #" + attr.class_index + ".#" + attr.method_index); |
228 + "\t// " + getJavaClassName(attr)); |
225 tab(); |
|
226 print("// " + getJavaClassName(attr)); |
229 if (attr.method_index != 0) |
227 if (attr.method_index != 0) |
230 print("." + getMethodName(attr)); |
228 print("." + getMethodName(attr)); |
231 println(); |
229 println(); |
232 return null; |
230 return null; |
233 } |
231 } |
323 return report(e); |
323 return report(e); |
324 } |
324 } |
325 } |
325 } |
326 |
326 |
327 private void writeInnerClassHeader() { |
327 private void writeInnerClassHeader() { |
328 print(" "); |
|
329 if (options.compat) // BUG 6622216: javap names some attributes incorrectly |
328 if (options.compat) // BUG 6622216: javap names some attributes incorrectly |
330 print("InnerClass"); |
329 print("InnerClass"); |
331 else |
330 else |
332 print("InnerClasses"); |
331 print("InnerClasses"); |
333 println(": "); |
332 println(": "); |
|
333 indent(+1); |
334 } |
334 } |
335 |
335 |
336 public Void visitLineNumberTable(LineNumberTable_attribute attr, Void ignore) { |
336 public Void visitLineNumberTable(LineNumberTable_attribute attr, Void ignore) { |
337 println(" LineNumberTable: "); |
337 println("LineNumberTable:"); |
|
338 indent(+1); |
338 for (LineNumberTable_attribute.Entry entry: attr.line_number_table) { |
339 for (LineNumberTable_attribute.Entry entry: attr.line_number_table) { |
339 println(" line " + entry.line_number + ": " + entry.start_pc); |
340 println("line " + entry.line_number + ": " + entry.start_pc); |
340 } |
341 } |
|
342 indent(-1); |
341 return null; |
343 return null; |
342 } |
344 } |
343 |
345 |
344 public Void visitLocalVariableTable(LocalVariableTable_attribute attr, Void ignore) { |
346 public Void visitLocalVariableTable(LocalVariableTable_attribute attr, Void ignore) { |
345 println(" LocalVariableTable: "); |
347 println("LocalVariableTable:"); |
346 println(" Start Length Slot Name Signature"); |
348 indent(+1); |
347 |
349 println("Start Length Slot Name Signature"); |
348 for (LocalVariableTable_attribute.Entry entry : attr.local_variable_table) { |
350 for (LocalVariableTable_attribute.Entry entry : attr.local_variable_table) { |
349 Formatter formatter = new Formatter(); |
351 Formatter formatter = new Formatter(); |
350 println(formatter.format("%8d %7d %5d %5s %s", |
352 println(formatter.format("%8d %7d %5d %5s %s", |
351 entry.start_pc, entry.length, entry.index, |
353 entry.start_pc, entry.length, entry.index, |
352 constantWriter.stringValue(entry.name_index), |
354 constantWriter.stringValue(entry.name_index), |
353 constantWriter.stringValue(entry.descriptor_index))); |
355 constantWriter.stringValue(entry.descriptor_index))); |
354 } |
356 } |
|
357 indent(-1); |
355 return null; |
358 return null; |
356 } |
359 } |
357 |
360 |
358 public Void visitLocalVariableTypeTable(LocalVariableTypeTable_attribute attr, Void ignore) { |
361 public Void visitLocalVariableTypeTable(LocalVariableTypeTable_attribute attr, Void ignore) { |
359 println(" LocalVariableTypeTable: "); |
362 println("LocalVariableTypeTable:"); |
360 println(" Start Length Slot Name Signature"); |
363 indent(+1); |
361 |
364 println("Start Length Slot Name Signature"); |
362 for (LocalVariableTypeTable_attribute.Entry entry : attr.local_variable_table) { |
365 for (LocalVariableTypeTable_attribute.Entry entry : attr.local_variable_table) { |
363 Formatter formatter = new Formatter(); |
366 println(String.format("%5d %7d %5d %5s %s", |
364 println(formatter.format("%8d %7d %5d %5s %s", |
|
365 entry.start_pc, entry.length, entry.index, |
367 entry.start_pc, entry.length, entry.index, |
366 constantWriter.stringValue(entry.name_index), |
368 constantWriter.stringValue(entry.name_index), |
367 constantWriter.stringValue(entry.signature_index))); |
369 constantWriter.stringValue(entry.signature_index))); |
368 } |
370 } |
|
371 indent(-1); |
369 return null; |
372 return null; |
370 } |
373 } |
371 |
374 |
372 public Void visitModule(Module_attribute attr, Void ignore) { |
375 public Void visitModule(Module_attribute attr, Void ignore) { |
373 println(" Module: #" + attr.module_name + "\t// " + getModuleName(attr)); |
376 print("Module: #" + attr.module_name); |
|
377 tab(); |
|
378 println("// " + getModuleName(attr)); |
374 return null; |
379 return null; |
375 } |
380 } |
376 |
381 |
377 String getModuleName(Module_attribute attr) { |
382 String getModuleName(Module_attribute attr) { |
378 try { |
383 try { |
381 return report(e); |
386 return report(e); |
382 } |
387 } |
383 } |
388 } |
384 |
389 |
385 public Void visitModuleExportTable(ModuleExportTable_attribute attr, Void ignore) { |
390 public Void visitModuleExportTable(ModuleExportTable_attribute attr, Void ignore) { |
386 println(" ModuleExportTable:"); |
391 println("ModuleExportTable:"); |
387 println(" Types: (" + attr.export_type_table.length + ")"); |
392 indent(+1); |
|
393 println("Types: (" + attr.export_type_table.length + ")"); |
388 for (int i = 0; i < attr.export_type_table.length; i++) { |
394 for (int i = 0; i < attr.export_type_table.length; i++) { |
389 println(" #" + attr.export_type_table[i] + "\t// " + getExportTypeName(attr, i)); |
395 print("#" + attr.export_type_table[i]); |
390 } |
396 tab(); |
|
397 println("// " + getExportTypeName(attr, i)); |
|
398 } |
|
399 indent(-1); |
391 return null; |
400 return null; |
392 } |
401 } |
393 |
402 |
394 String getExportTypeName(ModuleExportTable_attribute attr, int index) { |
403 String getExportTypeName(ModuleExportTable_attribute attr, int index) { |
395 try { |
404 try { |
398 return report(e); |
407 return report(e); |
399 } |
408 } |
400 } |
409 } |
401 |
410 |
402 public Void visitModuleMemberTable(ModuleMemberTable_attribute attr, Void ignore) { |
411 public Void visitModuleMemberTable(ModuleMemberTable_attribute attr, Void ignore) { |
403 println(" ModuleMemberTable:"); |
412 println("ModuleMemberTable:"); |
404 println(" Packages: (" + attr.package_member_table.length + ")"); |
413 indent(+1); |
|
414 println("Packages: (" + attr.package_member_table.length + ")"); |
405 for (int i = 0; i < attr.package_member_table.length; i++) { |
415 for (int i = 0; i < attr.package_member_table.length; i++) { |
406 println(" #" + attr.package_member_table[i] + "\t// " + getPackageMemberName(attr, i)); |
416 print("#" + attr.package_member_table[i]); |
407 } |
417 tab(); |
|
418 println("// " + getPackageMemberName(attr, i)); |
|
419 } |
|
420 indent(-1); |
408 return null; |
421 return null; |
409 } |
422 } |
410 |
423 |
411 String getPackageMemberName(ModuleMemberTable_attribute attr, int index) { |
424 String getPackageMemberName(ModuleMemberTable_attribute attr, int index) { |
412 try { |
425 try { |
415 return report(e); |
428 return report(e); |
416 } |
429 } |
417 } |
430 } |
418 |
431 |
419 public Void visitRuntimeVisibleAnnotations(RuntimeVisibleAnnotations_attribute attr, Void ignore) { |
432 public Void visitRuntimeVisibleAnnotations(RuntimeVisibleAnnotations_attribute attr, Void ignore) { |
420 println(" RuntimeVisibleAnnotations: "); |
433 println("RuntimeVisibleAnnotations:"); |
|
434 indent(+1); |
421 for (int i = 0; i < attr.annotations.length; i++) { |
435 for (int i = 0; i < attr.annotations.length; i++) { |
422 print(" " + i + ": "); |
436 print(i + ": "); |
423 annotationWriter.write(attr.annotations[i]); |
437 annotationWriter.write(attr.annotations[i]); |
424 println(); |
438 println(); |
425 } |
439 } |
|
440 indent(-1); |
426 return null; |
441 return null; |
427 } |
442 } |
428 |
443 |
429 public Void visitRuntimeInvisibleAnnotations(RuntimeInvisibleAnnotations_attribute attr, Void ignore) { |
444 public Void visitRuntimeInvisibleAnnotations(RuntimeInvisibleAnnotations_attribute attr, Void ignore) { |
430 println(" RuntimeInvisibleAnnotations: "); |
445 println("RuntimeInvisibleAnnotations:"); |
|
446 indent(+1); |
431 for (int i = 0; i < attr.annotations.length; i++) { |
447 for (int i = 0; i < attr.annotations.length; i++) { |
432 print(" " + i + ": "); |
448 print(i + ": "); |
433 annotationWriter.write(attr.annotations[i]); |
449 annotationWriter.write(attr.annotations[i]); |
434 println(); |
450 println(); |
435 } |
451 } |
|
452 indent(-1); |
436 return null; |
453 return null; |
437 } |
454 } |
438 |
455 |
439 public Void visitRuntimeVisibleTypeAnnotations(RuntimeVisibleTypeAnnotations_attribute attr, Void ignore) { |
456 public Void visitRuntimeVisibleTypeAnnotations(RuntimeVisibleTypeAnnotations_attribute attr, Void ignore) { |
440 println(" RuntimeVisibleTypeAnnotations: "); |
457 println("RuntimeVisibleTypeAnnotations:"); |
|
458 indent(+1); |
441 for (int i = 0; i < attr.annotations.length; i++) { |
459 for (int i = 0; i < attr.annotations.length; i++) { |
442 print(" " + i + ": "); |
460 print(i + ": "); |
443 annotationWriter.write(attr.annotations[i]); |
461 annotationWriter.write(attr.annotations[i]); |
444 println(); |
462 println(); |
445 } |
463 } |
|
464 indent(-1); |
446 return null; |
465 return null; |
447 } |
466 } |
448 |
467 |
449 public Void visitRuntimeInvisibleTypeAnnotations(RuntimeInvisibleTypeAnnotations_attribute attr, Void ignore) { |
468 public Void visitRuntimeInvisibleTypeAnnotations(RuntimeInvisibleTypeAnnotations_attribute attr, Void ignore) { |
450 println(" RuntimeInvisibleTypeAnnotations: "); |
469 println("RuntimeInvisibleTypeAnnotations:"); |
|
470 indent(+1); |
451 for (int i = 0; i < attr.annotations.length; i++) { |
471 for (int i = 0; i < attr.annotations.length; i++) { |
452 print(" " + i + ": "); |
472 print(i + ": "); |
453 annotationWriter.write(attr.annotations[i]); |
473 annotationWriter.write(attr.annotations[i]); |
454 println(); |
474 println(); |
455 } |
475 } |
|
476 indent(-1); |
456 return null; |
477 return null; |
457 } |
478 } |
458 |
479 |
459 public Void visitRuntimeVisibleParameterAnnotations(RuntimeVisibleParameterAnnotations_attribute attr, Void ignore) { |
480 public Void visitRuntimeVisibleParameterAnnotations(RuntimeVisibleParameterAnnotations_attribute attr, Void ignore) { |
460 println(" RuntimeVisibleParameterAnnotations: "); |
481 println("RuntimeVisibleParameterAnnotations:"); |
|
482 indent(+1); |
461 for (int param = 0; param < attr.parameter_annotations.length; param++) { |
483 for (int param = 0; param < attr.parameter_annotations.length; param++) { |
462 println(" parameter " + param + ": "); |
484 println("parameter " + param + ": "); |
|
485 indent(+1); |
463 for (int i = 0; i < attr.parameter_annotations[param].length; i++) { |
486 for (int i = 0; i < attr.parameter_annotations[param].length; i++) { |
464 print(" " + i + ": "); |
487 print(i + ": "); |
465 annotationWriter.write(attr.parameter_annotations[param][i]); |
488 annotationWriter.write(attr.parameter_annotations[param][i]); |
466 println(); |
489 println(); |
467 } |
490 } |
468 } |
491 indent(-1); |
|
492 } |
|
493 indent(-1); |
469 return null; |
494 return null; |
470 } |
495 } |
471 |
496 |
472 public Void visitRuntimeInvisibleParameterAnnotations(RuntimeInvisibleParameterAnnotations_attribute attr, Void ignore) { |
497 public Void visitRuntimeInvisibleParameterAnnotations(RuntimeInvisibleParameterAnnotations_attribute attr, Void ignore) { |
473 println(" RuntimeInvisibleParameterAnnotations: "); |
498 println("RuntimeInvisibleParameterAnnotations:"); |
|
499 indent(+1); |
474 for (int param = 0; param < attr.parameter_annotations.length; param++) { |
500 for (int param = 0; param < attr.parameter_annotations.length; param++) { |
475 println(" " + param + ": "); |
501 println(param + ": "); |
|
502 indent(+1); |
476 for (int i = 0; i < attr.parameter_annotations[param].length; i++) { |
503 for (int i = 0; i < attr.parameter_annotations[param].length; i++) { |
477 print(" " + i + ": "); |
504 print(i + ": "); |
478 annotationWriter.write(attr.parameter_annotations[param][i]); |
505 annotationWriter.write(attr.parameter_annotations[param][i]); |
479 println(); |
506 println(); |
480 } |
507 } |
481 } |
508 indent(-1); |
|
509 } |
|
510 indent(-1); |
482 return null; |
511 return null; |
483 } |
512 } |
484 |
513 |
485 public Void visitSignature(Signature_attribute attr, Void ignore) { |
514 public Void visitSignature(Signature_attribute attr, Void ignore) { |
486 println(" Signature: #" + attr.signature_index + "\t// " + getSignature(attr)); |
515 print("Signature: #" + attr.signature_index); |
|
516 tab(); |
|
517 println("// " + getSignature(attr)); |
487 return null; |
518 return null; |
488 } |
519 } |
489 |
520 |
490 String getSignature(Signature_attribute info) { |
521 String getSignature(Signature_attribute info) { |
491 try { |
522 try { |
517 constantWriter.write(attr.sourceID_index); |
548 constantWriter.write(attr.sourceID_index); |
518 return null; |
549 return null; |
519 } |
550 } |
520 |
551 |
521 public Void visitStackMap(StackMap_attribute attr, Void ignore) { |
552 public Void visitStackMap(StackMap_attribute attr, Void ignore) { |
522 println(" StackMap: number_of_entries = " + attr.number_of_entries); |
553 println("StackMap: number_of_entries = " + attr.number_of_entries); |
523 |
554 indent(+1); |
524 StackMapTableWriter w = new StackMapTableWriter(); |
555 StackMapTableWriter w = new StackMapTableWriter(); |
525 for (StackMapTable_attribute.stack_map_frame entry : attr.entries) { |
556 for (StackMapTable_attribute.stack_map_frame entry : attr.entries) { |
526 w.write(entry); |
557 w.write(entry); |
527 } |
558 } |
528 println(); |
559 println(); |
|
560 indent(-1); |
529 return null; |
561 return null; |
530 } |
562 } |
531 |
563 |
532 public Void visitStackMapTable(StackMapTable_attribute attr, Void ignore) { |
564 public Void visitStackMapTable(StackMapTable_attribute attr, Void ignore) { |
533 println(" StackMapTable: number_of_entries = " + attr.number_of_entries); |
565 println("StackMapTable: number_of_entries = " + attr.number_of_entries); |
534 |
566 indent(+1); |
535 StackMapTableWriter w = new StackMapTableWriter(); |
567 StackMapTableWriter w = new StackMapTableWriter(); |
536 for (StackMapTable_attribute.stack_map_frame entry : attr.entries) { |
568 for (StackMapTable_attribute.stack_map_frame entry : attr.entries) { |
537 w.write(entry); |
569 w.write(entry); |
538 } |
570 } |
539 println(); |
571 println(); |
|
572 indent(-1); |
540 return null; |
573 return null; |
541 } |
574 } |
542 |
575 |
543 class StackMapTableWriter // also handles CLDC StackMap attributes |
576 class StackMapTableWriter // also handles CLDC StackMap attributes |
544 implements StackMapTable_attribute.stack_map_frame.Visitor<Void,Void> { |
577 implements StackMapTable_attribute.stack_map_frame.Visitor<Void,Void> { |
553 } |
586 } |
554 |
587 |
555 public Void visit_same_locals_1_stack_item_frame(StackMapTable_attribute.same_locals_1_stack_item_frame frame, Void p) { |
588 public Void visit_same_locals_1_stack_item_frame(StackMapTable_attribute.same_locals_1_stack_item_frame frame, Void p) { |
556 printHeader(frame); |
589 printHeader(frame); |
557 println(" /* same_locals_1_stack_item */"); |
590 println(" /* same_locals_1_stack_item */"); |
|
591 indent(+1); |
558 printMap("stack", frame.stack); |
592 printMap("stack", frame.stack); |
|
593 indent(-1); |
559 return null; |
594 return null; |
560 } |
595 } |
561 |
596 |
562 public Void visit_same_locals_1_stack_item_frame_extended(StackMapTable_attribute.same_locals_1_stack_item_frame_extended frame, Void p) { |
597 public Void visit_same_locals_1_stack_item_frame_extended(StackMapTable_attribute.same_locals_1_stack_item_frame_extended frame, Void p) { |
563 printHeader(frame); |
598 printHeader(frame); |
564 println(" /* same_locals_1_stack_item_frame_extended */"); |
599 println(" /* same_locals_1_stack_item_frame_extended */"); |
565 println(" offset_delta = " + frame.offset_delta); |
600 indent(+1); |
|
601 println("offset_delta = " + frame.offset_delta); |
566 printMap("stack", frame.stack); |
602 printMap("stack", frame.stack); |
|
603 indent(-1); |
567 return null; |
604 return null; |
568 } |
605 } |
569 |
606 |
570 public Void visit_chop_frame(StackMapTable_attribute.chop_frame frame, Void p) { |
607 public Void visit_chop_frame(StackMapTable_attribute.chop_frame frame, Void p) { |
571 printHeader(frame); |
608 printHeader(frame); |
572 println(" /* chop */"); |
609 println(" /* chop */"); |
573 println(" offset_delta = " + frame.offset_delta); |
610 indent(+1); |
|
611 println("offset_delta = " + frame.offset_delta); |
|
612 indent(-1); |
574 return null; |
613 return null; |
575 } |
614 } |
576 |
615 |
577 public Void visit_same_frame_extended(StackMapTable_attribute.same_frame_extended frame, Void p) { |
616 public Void visit_same_frame_extended(StackMapTable_attribute.same_frame_extended frame, Void p) { |
578 printHeader(frame); |
617 printHeader(frame); |
579 println(" /* same_frame_extended */"); |
618 println(" /* same_frame_extended */"); |
580 println(" offset_delta = " + frame.offset_delta); |
619 indent(+1); |
|
620 println("offset_delta = " + frame.offset_delta); |
|
621 indent(-1); |
581 return null; |
622 return null; |
582 } |
623 } |
583 |
624 |
584 public Void visit_append_frame(StackMapTable_attribute.append_frame frame, Void p) { |
625 public Void visit_append_frame(StackMapTable_attribute.append_frame frame, Void p) { |
585 printHeader(frame); |
626 printHeader(frame); |
590 } |
631 } |
591 |
632 |
592 public Void visit_full_frame(StackMapTable_attribute.full_frame frame, Void p) { |
633 public Void visit_full_frame(StackMapTable_attribute.full_frame frame, Void p) { |
593 printHeader(frame); |
634 printHeader(frame); |
594 if (frame instanceof StackMap_attribute.stack_map_frame) { |
635 if (frame instanceof StackMap_attribute.stack_map_frame) { |
595 println(" offset = " + frame.offset_delta); |
636 indent(+1); |
|
637 println(" offset = " + frame.offset_delta); |
596 } else { |
638 } else { |
597 println(" /* full_frame */"); |
639 println(" /* full_frame */"); |
598 println(" offset_delta = " + frame.offset_delta); |
640 indent(+1); |
|
641 println("offset_delta = " + frame.offset_delta); |
599 } |
642 } |
600 printMap("locals", frame.locals); |
643 printMap("locals", frame.locals); |
601 printMap("stack", frame.stack); |
644 printMap("stack", frame.stack); |
|
645 indent(-1); |
602 return null; |
646 return null; |
603 } |
647 } |
604 |
648 |
605 void printHeader(StackMapTable_attribute.stack_map_frame frame) { |
649 void printHeader(StackMapTable_attribute.stack_map_frame frame) { |
606 print(" frame_type = " + frame.frame_type); |
650 print(" frame_type = " + frame.frame_type); |
607 } |
651 } |
608 |
652 |
609 void printMap(String name, StackMapTable_attribute.verification_type_info[] map) { |
653 void printMap(String name, StackMapTable_attribute.verification_type_info[] map) { |
610 print(" " + name + " = ["); |
654 print(name + " = ["); |
611 for (int i = 0; i < map.length; i++) { |
655 for (int i = 0; i < map.length; i++) { |
612 StackMapTable_attribute.verification_type_info info = map[i]; |
656 StackMapTable_attribute.verification_type_info info = map[i]; |
613 int tag = info.tag; |
657 int tag = info.tag; |
614 switch (tag) { |
658 switch (tag) { |
615 case StackMapTable_attribute.verification_type_info.ITEM_Object: |
659 case StackMapTable_attribute.verification_type_info.ITEM_Object: |