< prev index next >

src/jdk.jdeps/share/classes/com/sun/tools/javap/StackMapWriter.java

Print this page
@@ -1,7 +1,7 @@
  /*
-  * Copyright (c) 2009, 2024, Oracle and/or its affiliates. All rights reserved.
+  * Copyright (c) 2009, 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

@@ -23,10 +23,11 @@
   * questions.
   */
  
  package com.sun.tools.javap;
  
+ import java.lang.classfile.constantpool.NameAndTypeEntry;
  import java.util.HashMap;
  import java.util.List;
  import java.util.Map;
  import java.lang.classfile.Attributes;
  import java.lang.classfile.ClassFile;

@@ -96,14 +97,33 @@
  
          var m = map.get(pc);
          if (m != null) {
              print("StackMap locals: ", m.locals(), true);
              print("StackMap stack: ", m.stack(), false);
+             if (!m.unsetFields().isEmpty()) {
+                 printFields("StackMap unset fields: ", m.unsetFields());
+             }
          }
  
      }
  
+     void printFields(String label, List<NameAndTypeEntry> entries) {
+         print(label);
+         boolean first = true;
+         for (var e : entries) {
+             if (!first) {
+                 print(", ");
+             } else {
+                 first = false;
+             }
+             print(e::name);
+             print(":");
+             print(e::type);
+         }
+         println();
+     }
+ 
      void print(String label, List<StackMapFrameInfo.VerificationTypeInfo> entries,
              boolean firstThis) {
          print(label);
          for (var e : entries) {
              print(" ");
< prev index next >