Integrated: Milestone 1
Kelvin Nilsen
kdnilsen at openjdk.java.net
Thu Feb 4 08:48:01 UTC 2021
On Thu, 21 Jan 2021 18:31:05 GMT, Kelvin Nilsen <kdnilsen at openjdk.org> wrote:
> 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;
> }
> }
This pull request has now been integrated.
Changeset: 28fc3420
Author: Kelvin Nilsen <kdnilsen at openjdk.org>
Committer: Roman Kennke <rkennke at openjdk.org>
URL: https://git.openjdk.java.net/shenandoah/commit/28fc3420
Stats: 986 lines in 9 files changed: 984 ins; 1 del; 1 mod
Milestone 1
Reviewed-by: rkennke, adityam
-------------
PR: https://git.openjdk.java.net/shenandoah/pull/13
More information about the shenandoah-dev
mailing list