< prev index next > src/jdk.jdeps/share/classes/com/sun/tools/classfile/ClassWriter.java
Print this page
/*
- * Copyright (c) 2008, 2020, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2008, 2025, Oracle and/or its affiliates. All rights reserved.
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
*
* This code is free software; you can redistribute it and/or modify it
* under the terms of the GNU General Public License version 2 only, as
* published by the Free Software Foundation. Oracle designates this
public Void visitStackMap(StackMap_attribute attr, ClassOutputStream out) {
if (stackMapWriter == null)
stackMapWriter = new StackMapTableWriter();
out.writeShort(attr.entries.length);
- for (stack_map_frame f: attr.entries)
+ for (stack_map_entry f: attr.entries)
stackMapWriter.write(f, out);
return null;
}
@Override
public Void visitStackMapTable(StackMapTable_attribute attr, ClassOutputStream out) {
if (stackMapWriter == null)
stackMapWriter = new StackMapTableWriter();
out.writeShort(attr.entries.length);
- for (stack_map_frame f: attr.entries)
+ for (stack_map_entry f: attr.entries)
stackMapWriter.write(f, out);
return null;
}
@Override
public Void visitSynthetic(Synthetic_attribute attr, ClassOutputStream out) {
return null;
}
+ @Override
+ public Void visitLoadableDescriptors(LoadableDescriptors_attribute attr, ClassOutputStream out) {
+ out.writeShort(attr.descriptors.length);
+ for (int index: attr.descriptors)
+ out.writeShort(index);
+ return null;
+ }
+
protected void writeAccessFlags(AccessFlags flags, ClassOutputStream out) {
out.writeShort(flags.flags);
}
protected StackMapTableWriter stackMapWriter;
/**
* Writer for the frames of StackMap and StackMapTable attributes.
*/
protected static class StackMapTableWriter
- implements stack_map_frame.Visitor<Void,ClassOutputStream> {
+ implements stack_map_entry.Visitor<Void,ClassOutputStream> {
- public void write(stack_map_frame frame, ClassOutputStream out) {
- out.write(frame.frame_type);
+ public void write(stack_map_entry frame, ClassOutputStream out) {
+ out.write(frame.entry_type);
frame.accept(this, out);
}
@Override
public Void visit_same_frame(same_frame frame, ClassOutputStream p) {
for (verification_type_info s: frame.stack)
writeVerificationTypeInfo(s, out);
return null;
}
+ @Override
+ public Void visit_assert_unset_fields(assert_unset_fields frame, ClassOutputStream out) {
+ out.writeShort(frame.number_of_unset_fields);
+ for (int uf: frame.unset_fields) {
+ out.writeShort(uf);
+ }
+ return null;
+ }
+
protected void writeVerificationTypeInfo(verification_type_info info,
ClassOutputStream out) {
out.write(info.tag);
switch (info.tag) {
case ITEM_Top:
< prev index next >