< prev index next >

src/jdk.jdeps/share/classes/com/sun/tools/classfile/ClassWriter.java

Print this page

 737                 stackMapWriter.write(f, out);
 738             return null;
 739         }
 740 
 741         @Override
 742         public Void visitStackMapTable(StackMapTable_attribute attr, ClassOutputStream out) {
 743             if (stackMapWriter == null)
 744                 stackMapWriter = new StackMapTableWriter();
 745 
 746             out.writeShort(attr.entries.length);
 747             for (stack_map_frame f: attr.entries)
 748                 stackMapWriter.write(f, out);
 749             return null;
 750         }
 751 
 752         @Override
 753         public Void visitSynthetic(Synthetic_attribute attr, ClassOutputStream out) {
 754             return null;
 755         }
 756 








 757         protected void writeAccessFlags(AccessFlags flags, ClassOutputStream out) {
 758             out.writeShort(flags.flags);
 759         }
 760 
 761         protected StackMapTableWriter stackMapWriter;
 762     }
 763 
 764     /**
 765      * Writer for the frames of StackMap and StackMapTable attributes.
 766      */
 767     protected static class StackMapTableWriter
 768             implements stack_map_frame.Visitor<Void,ClassOutputStream> {
 769 
 770         public void write(stack_map_frame frame, ClassOutputStream out) {
 771             out.write(frame.frame_type);
 772             frame.accept(this, out);
 773         }
 774 
 775         @Override
 776         public Void visit_same_frame(same_frame frame, ClassOutputStream p) {

 737                 stackMapWriter.write(f, out);
 738             return null;
 739         }
 740 
 741         @Override
 742         public Void visitStackMapTable(StackMapTable_attribute attr, ClassOutputStream out) {
 743             if (stackMapWriter == null)
 744                 stackMapWriter = new StackMapTableWriter();
 745 
 746             out.writeShort(attr.entries.length);
 747             for (stack_map_frame f: attr.entries)
 748                 stackMapWriter.write(f, out);
 749             return null;
 750         }
 751 
 752         @Override
 753         public Void visitSynthetic(Synthetic_attribute attr, ClassOutputStream out) {
 754             return null;
 755         }
 756 
 757         @Override
 758         public Void visitLoadableDescriptors(LoadableDescriptors_attribute attr, ClassOutputStream out) {
 759             out.writeShort(attr.descriptors.length);
 760             for (int index: attr.descriptors)
 761                 out.writeShort(index);
 762             return null;
 763         }
 764 
 765         protected void writeAccessFlags(AccessFlags flags, ClassOutputStream out) {
 766             out.writeShort(flags.flags);
 767         }
 768 
 769         protected StackMapTableWriter stackMapWriter;
 770     }
 771 
 772     /**
 773      * Writer for the frames of StackMap and StackMapTable attributes.
 774      */
 775     protected static class StackMapTableWriter
 776             implements stack_map_frame.Visitor<Void,ClassOutputStream> {
 777 
 778         public void write(stack_map_frame frame, ClassOutputStream out) {
 779             out.write(frame.frame_type);
 780             frame.accept(this, out);
 781         }
 782 
 783         @Override
 784         public Void visit_same_frame(same_frame frame, ClassOutputStream p) {
< prev index next >