< prev index next >

test/hotspot/jtreg/vmTestbase/nsk/share/gc/NonbranchyTree.java

Print this page
*** 169,20 ***
  
  // The class defines a node of a tree
  class Node {
      Node left;
      Node right;
!     byte[] core;
  
      Node(int size) {
          left = null;
          right = null;
!         core = new byte[size];
  
-         // Initizlize the core array
-         for (int i = 0; i < size; i++)
-             core[i] = (byte) i;
      }
  
      // Print the node info
      void print(PrintStream out) {
          out.println("node = " + this + " (" + left + ", " + right + ")");
--- 169,29 ---
  
  // The class defines a node of a tree
  class Node {
      Node left;
      Node right;
!     Object storage;
  
      Node(int size) {
          left = null;
          right = null;
!         // Initialize the core array
+         if (Memory.isValhallaEnabled()) {
+             Byte[] core = new Byte[size];
+             for (int i = 0; i < core.length; i++) {
+                 core[i] = (byte) i;
+             }
+             storage = core;
+         } else {
+             byte[] core = new byte[size];
+             for (int i = 0; i < size; i++)
+                 core[i] = (byte) i;
+             storage = core;
+         }
  
      }
  
      // Print the node info
      void print(PrintStream out) {
          out.println("node = " + this + " (" + left + ", " + right + ")");
< prev index next >