< prev index next >

test/hotspot/jtreg/gc/stress/gcbasher/Decompiler.java

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

@@ -26,11 +26,11 @@
  
  class Decompiler {
      private ByteCursor cursor;
      private ClassInfo ci;
  
-     public Decompiler(byte[] classData) {
+     public Decompiler(Byte[] classData) {
          cursor = new ByteCursor(classData);
  
          int magicNumber = cursor.readInt();
          if (magicNumber != 0xCAFEBABE) {
              throw new IllegalArgumentException("Bad magic number " + magicNumber);

@@ -67,11 +67,11 @@
      private boolean isDependency(String name, String className) {
          return !name.equals(className) && !name.startsWith("[");
      }
  
      private void addDependency(MethodInfo m, String name) {
-         Dependency d = new Dependency(m.getName(), m.getDescriptor(), name);
+         Dependency d = new Dependency(m.name(), m.descriptor(), name);
          ci.addResolutionDep(d);
      }
  
      private String resolveName(ConstantPoolEntry[] constantPool, int cpi) {
          int nameIndex = constantPool[cpi].getNameIndex();

@@ -79,13 +79,13 @@
      }
  
      private void decodeMethodDependencies(MethodInfo[] methods, ConstantPoolEntry[] constantPool) {
          for (int i = 0; i < methods.length; i++) {
              MethodInfo m = methods[i];
-             final int stopCheck = m.getCodeStart() + m.getCodeLength();
+             final int stopCheck = m.codeStart() + m.codeLength();
  
-             int byteCodeIndex = m.getCodeStart();
+             int byteCodeIndex = m.codeStart();
              while (byteCodeIndex < stopCheck) {
                  int bc = cursor.readUnsignedByteAt(byteCodeIndex);
  
                  switch (bc) {
                      // These opcodes cause name resolution or initialization

@@ -124,11 +124,11 @@
                          break;
                      }
  
                      case Bytecode.LOOKUPSWITCH: {
                          byteCodeIndex++;
-                         int offset = byteCodeIndex - m.getCodeStart();
+                         int offset = byteCodeIndex - m.codeStart();
                          while (offset % 4 != 0) {
                              offset++;
                              byteCodeIndex++;
                          }
  

@@ -141,11 +141,11 @@
                          continue;
                      }
  
                      case Bytecode.TABLESWITCH: {
                          byteCodeIndex++;
-                         int offset = byteCodeIndex - m.getCodeStart();
+                         int offset = byteCodeIndex - m.codeStart();
                          while (offset % 4 != 0) {
                              offset++;
                              byteCodeIndex++;
                          }
  

@@ -173,11 +173,11 @@
  
                  byteCodeIndex += Bytecode.getLength(bc);
              }
  
              if (byteCodeIndex - stopCheck > 1) {
-                 String err = "bad finish for method " + m.getName() +
+                 String err = "bad finish for method " + m.name() +
                               "End + "  + (byteCodeIndex - stopCheck);
                  throw new IllegalArgumentException(err);
              }
          }
      }

@@ -189,12 +189,12 @@
              cursor.readUnsignedShort(); // access flags
  
              String name = constantPool[cursor.readUnsignedShort()].getValue();
              String descriptor = constantPool[cursor.readUnsignedShort()].getValue();
  
-             int codeLength = 0;
-             int codeStart = 0;
+             Integer codeLength = 0;
+             Integer codeStart = 0;
  
              int numAttributes = cursor.readUnsignedShort(); // attributes count
              for (int j = 0; j < numAttributes; j++) {
                  int type = cursor.readUnsignedShort(); // attrib nameIndex
                  int aLen = cursor.readInt(); // attrib length
< prev index next >