Skip to content

Commit 5df8343

Browse files
committed
Use a constant for max heap space argument.
1 parent 4e3d85d commit 5df8343

File tree

2 files changed

+15
-8
lines changed

2 files changed

+15
-8
lines changed

compiler/src/jdk.graal.compiler.test/src/jdk/graal/compiler/hotspot/test/TestNewInstanceWithException.java

Lines changed: 12 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -569,6 +569,11 @@ public void runSubprocessTest(Runnable r, String... args) throws IOException, In
569569
}
570570
}
571571

572+
/**
573+
* The argument setting the maximum heap space of the subprocess.
574+
*/
575+
public static String MAX_HEAP_SPACE_ARG = "-Xmx64m";
576+
572577
public static class TestNewInstanceWithException1 extends TestNewInstanceWithException {
573578

574579
@Test
@@ -579,7 +584,7 @@ public void testNewArrayWithException() throws IOException, InterruptedException
579584
} catch (InvalidInstalledCodeException e) {
580585
throw GraalError.shouldNotReachHere(e);
581586
}
582-
}, "-Xmx64m");
587+
}, MAX_HEAP_SPACE_ARG);
583588
}
584589
}
585590

@@ -592,7 +597,7 @@ public void testNewInstanceWithException() throws IOException, InterruptedExcept
592597
} catch (InvalidInstalledCodeException e) {
593598
throw GraalError.shouldNotReachHere(e);
594599
}
595-
}, "-Xmx64m");
600+
}, MAX_HEAP_SPACE_ARG);
596601
}
597602
}
598603

@@ -605,7 +610,7 @@ public void testDynamicNewInstanceWithException() throws Throwable {
605610
} catch (Throwable e) {
606611
throw GraalError.shouldNotReachHere(e);
607612
}
608-
}, "-Xmx64m");
613+
}, MAX_HEAP_SPACE_ARG);
609614
}
610615
}
611616

@@ -618,7 +623,7 @@ public void testDynamicNewInstanceWithExceptionCanonToInstanceWithException() th
618623
} catch (Throwable e) {
619624
throw GraalError.shouldNotReachHere(e);
620625
}
621-
}, "-Xmx64m");
626+
}, MAX_HEAP_SPACE_ARG);
622627
}
623628
}
624629

@@ -631,7 +636,7 @@ public void testDynamicNewArrayWithException() throws Throwable {
631636
} catch (Throwable e) {
632637
throw GraalError.shouldNotReachHere(e);
633638
}
634-
}, "-Xmx64m");
639+
}, MAX_HEAP_SPACE_ARG);
635640
}
636641
}
637642

@@ -644,7 +649,7 @@ public void testDynamicNewArrayWithExceptionCanonToArrayWithException() throws T
644649
} catch (Throwable e) {
645650
throw GraalError.shouldNotReachHere(e);
646651
}
647-
}, "-Xmx64m");
652+
}, MAX_HEAP_SPACE_ARG);
648653
}
649654
}
650655

@@ -657,7 +662,7 @@ public void testNewMultiArrayWithException() throws Throwable {
657662
} catch (Throwable e) {
658663
throw GraalError.shouldNotReachHere(e);
659664
}
660-
}, "-Xmx64m");
665+
}, MAX_HEAP_SPACE_ARG);
661666
}
662667
}
663668
}

compiler/src/jdk.graal.compiler.test/src/jdk/graal/compiler/hotspot/test/TestNewInstanceWithExceptionRegression.java

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -24,6 +24,8 @@
2424
*/
2525
package jdk.graal.compiler.hotspot.test;
2626

27+
import static jdk.graal.compiler.hotspot.test.TestNewInstanceWithException.MAX_HEAP_SPACE_ARG;
28+
2729
import java.io.IOException;
2830
import java.util.ArrayList;
2931
import java.util.Collections;
@@ -70,7 +72,7 @@ public void test01() throws IOException, InterruptedException {
7072
} catch (Throwable e) {
7173
throw GraalError.shouldNotReachHere(e);
7274
}
73-
}, "-Xmx64m");
75+
}, MAX_HEAP_SPACE_ARG);
7476
}
7577

7678
}

0 commit comments

Comments
 (0)