RFR: Milestone 1 [v2]

Kelvin Nilsen kdnilsen at openjdk.java.net
Tue Feb 2 22:29:56 UTC 2021


> The objective of Milestone-1 is to demonstrate that certain heap regions can be designated as representing old-gen, card marking and remembered set implementation do not crash. Since the current implementation does not promote objects into old-gen space, much of the implementation of card marking and remembered set scanning is not exercised.
> 
> The following simple test program was used to demonstrate execution:
> 
> public class hello {
>   public static void main(String args[]) {
>     Node n = null;
>     for (int count = 10000; count > 0; count--) {
>       n = Node.upheaval(n);
>       System.out.print(count);
>       System.out.print(": Hello world: ");
>       for (int i = 0; i < args.length; i++) {
> 	System.out.print(args[i]);
> 	System.out.print(" ");
>       }
>       System.out.print("[node value is " + n.value() + "]");
>       System.out.println("");
>     }
>   }
> }
> 
> import java.util.Random;
> 
> public class Node {
>   static private final int NeighborCount = 5;
>   static private Random random = new Random(46);
> 
>   private int val;
>   private Object field_o;
> 
>   private int[] field_ints;
>   private Node [] neighbors;
> 
>   // Copy each neighbor of n into new node's neighbor array.  Then overwrite
>   // arbitrarily selected neighbor with newly allocated leaf node.
>   public static Node upheaval(Node n) {
>     int first_val = random.nextInt();
>     if (first_val < 0) first_val = -first_val;
>     if (first_val < 0) first_val = 0;
>     Node result = new Node(first_val);
>     if (n != null) {
>       for (int i = 0; i < NeighborCount; i++)
> 	result.neighbors[i] = n.neighbors[i];
>     }
>     int second_val = random.nextInt();
>     if (second_val < 0) second_val = -second_val;
>     if (second_val < 0) second_val = 0;
>     int overwrite_index = first_val % NeighborCount;
>     result.neighbors[overwrite_index] = new Node(second_val);
>     return result;
>   }
>   
>   public Node(int val) {
>     this.val = val;
>     this.field_o = new Object();
>     this.field_ints = new int[8];
>     this.field_ints[0] = 0xca;
>     this.field_ints[1] = 0xfe;
>     this.field_ints[2] = 0xba;
>     this.field_ints[3] = 0xbe;
>     this.field_ints[4] = 0xba;
>     this.field_ints[5] = 0xad;
>     this.field_ints[6] = 0xba;
>     this.field_ints[7] = 0xbe;
>     this.neighbors = new Node[NeighborCount];
>   }
> 
>   public int value() {
>     return val;
>   }
> }

Kelvin Nilsen has updated the pull request incrementally with one additional commit since the last revision:

  Addressed reviewer feedback
  
  Removed unneeded include in shenandoahCardTable.cpp.  Established a new
  jtreg subdirectory for generational tests with accompanying changes to
  TEST.groups to exercise the new tests.

-------------

Changes:
  - all: https://git.openjdk.java.net/shenandoah/pull/13/files
  - new: https://git.openjdk.java.net/shenandoah/pull/13/files/7c425251..f6df6aa5

Webrevs:
 - full: https://webrevs.openjdk.java.net/?repo=shenandoah&pr=13&range=01
 - incr: https://webrevs.openjdk.java.net/?repo=shenandoah&pr=13&range=00-01

  Stats: 199 lines in 4 files changed: 198 ins; 1 del; 0 mod
  Patch: https://git.openjdk.java.net/shenandoah/pull/13.diff
  Fetch: git fetch https://git.openjdk.java.net/shenandoah pull/13/head:pull/13

PR: https://git.openjdk.java.net/shenandoah/pull/13


More information about the shenandoah-dev mailing list