collection of small fixes from running runtime tests with -Xcomp

Tobias Hartmann tobias.hartmann at oracle.com
Wed Mar 15 08:00:54 UTC 2017


Hi Roland,

On 14.03.2017 17:16, Roland Westrelin wrote:
> Because of method handles, in SharedRuntime::allocate_value_types()
> using the static target is not good enough because its signature of the
> static target might differ from the signature of the actual callee. So
> instead, the runtime call is now passed the actual target which is good
> because we also probably need to do something to keep it alive.

Please add a TODO to the "required to keep callee live?" comments so we can easily find those locations later.

> The bcEscapeAnalyzer.cpp fix is obvious.
> 
> We can't use the value factory parameter mapping until the value class
> is initialized: added an assert and an uncommon trap so the assert
> doesn't fire.

Looks good!

> Sometimes a lambda form compiled as the root of a compilation has a
> signature with object parameters but is passed a value type: so it's
> passed fields but has no way to know. This could be fixed by always
> passing value types as references when the target is a lambda form. But
> then, method handles intrinsics could get reference inputs and call a
> method that expects value types to be passed as fields. So the code in
> MethodHandles::generate_method_handle_dispatch() would need to be
> adjusted to shuffle arguments. That all sounds too complicated so
> instead I disallowed lambda form as root of compilations.

I wonder if it's okay to treat value types as objects in such cases.

Zoltan, you found some related problems right?

I think it would make sense to add "-Xcomp -XX:-TieredCompilation" to the runtime tests (I did that before, see patch below).

Thanks,
Tobias


--- old/test/runtime/valhalla/valuetypes/DeriveValueTypeCreation.java	2017-03-15 08:54:48.004842144 +0100
+++ new/test/runtime/valhalla/valuetypes/DeriveValueTypeCreation.java	2017-03-15 08:54:47.936842147 +0100
@@ -43,6 +43,7 @@
  * @library /testlibrary /
  * @build runtime.valhalla.valuetypes.ValueCapableClass
  * @run main/othervm -Xint -noverify runtime.valhalla.valuetypes.DeriveValueTypeCreation
+ * @run main/othervm -Xcomp -XX:-TieredCompilation -noverify runtime.valhalla.valuetypes.DeriveValueTypeCreation
  */
 public class DeriveValueTypeCreation {
 
--- old/test/runtime/valhalla/valuetypes/InvokeDirect.java	2017-03-15 08:54:48.256842132 +0100
+++ new/test/runtime/valhalla/valuetypes/InvokeDirect.java	2017-03-15 08:54:48.188842136 +0100
@@ -7,6 +7,7 @@
  * @summary Value Type invokedirect bytecode test (incomplete until type system defn done)
  * @library /testlibrary /
  * @run main/othervm -noverify -Xint runtime.valhalla.valuetypes.InvokeDirect
+ * @run main/othervm -noverify -Xcomp -XX:-TieredCompilation runtime.valhalla.valuetypes.InvokeDirect
  */
 public class InvokeDirect {
     public static void main(String[] args) {
--- old/test/runtime/valhalla/valuetypes/VDefaultTest.java	2017-03-15 08:54:48.512842121 +0100
+++ new/test/runtime/valhalla/valuetypes/VDefaultTest.java	2017-03-15 08:54:48.444842124 +0100
@@ -30,6 +30,7 @@
  * @summary vdefault bytecode test
  * @library /testlibrary /
  * @run main/othervm -noverify -Xint runtime.valhalla.valuetypes.VDefaultTest
+ * @run main/othervm -noverify -Xcomp -XX:-TieredCompilation runtime.valhalla.valuetypes.VDefaultTest
  */
 
 public class VDefaultTest {
--- old/test/runtime/valhalla/valuetypes/VWithFieldTest.java	2017-03-15 08:54:48.756842109 +0100
+++ new/test/runtime/valhalla/valuetypes/VWithFieldTest.java	2017-03-15 08:54:48.692842112 +0100
@@ -30,6 +30,7 @@
  * @summary vwithfield bytecode test
  * @library /testlibrary /
  * @run main/othervm -noverify -Xint runtime.valhalla.valuetypes.VWithFieldTest
+ * @run main/othervm -noverify -Xcomp -XX:-TieredCompilation runtime.valhalla.valuetypes.VWithFieldTest
  */
 
 public class VWithFieldTest {
--- old/test/runtime/valhalla/valuetypes/ValueTypeArray.java	2017-03-15 08:54:49.000842098 +0100
+++ new/test/runtime/valhalla/valuetypes/ValueTypeArray.java	2017-03-15 08:54:48.936842101 +0100
@@ -33,6 +33,8 @@
  * @library /testlibrary /
  * @run main/othervm -noverify -Xint -XX:+ValueArrayFlatten runtime.valhalla.valuetypes.ValueTypeArray
  * @run main/othervm -noverify -Xint -XX:-ValueArrayFlatten runtime.valhalla.valuetypes.ValueTypeArray
+ * @run main/othervm -noverify -Xcomp -XX:-TieredCompilation -XX:+ValueArrayFlatten runtime.valhalla.valuetypes.ValueTypeArray
+ * @run main/othervm -noverify -Xcomp -XX:-TieredCompilation -XX:-ValueArrayFlatten runtime.valhalla.valuetypes.ValueTypeArray
  */
 public class ValueTypeArray {
     public static void main(String[] args) {
--- old/test/runtime/valhalla/valuetypes/ValueTypeCreation.java	2017-03-15 08:54:49.248842086 +0100
+++ new/test/runtime/valhalla/valuetypes/ValueTypeCreation.java	2017-03-15 08:54:49.180842089 +0100
@@ -7,6 +7,7 @@
  * @summary Value Type creation test
  * @library /testlibrary /
  * @run main/othervm -noverify -Xint runtime.valhalla.valuetypes.ValueTypeCreation
+ * @run main/othervm -noverify -Xcomp -XX:-TieredCompilation runtime.valhalla.valuetypes.ValueTypeCreation
  */
 public class ValueTypeCreation {
     public static void main(String[] args) {
--- old/test/runtime/valhalla/valuetypes/ValueTypeDensity.java	2017-03-15 08:54:49.496842075 +0100
+++ new/test/runtime/valhalla/valuetypes/ValueTypeDensity.java	2017-03-15 08:54:49.428842078 +0100
@@ -36,6 +36,7 @@
  * @run driver ClassFileInstaller sun.hotspot.WhiteBox
  *                                sun.hotspot.WhiteBox$WhiteBoxPermission
  * @run main/othervm -noverify -Xint -XX:+ValueArrayFlatten -Xbootclasspath/a:. -XX:+UnlockDiagnosticVMOptions -XX:+WhiteBoxAPI ValueTypeDensity
+ * @run main/othervm -noverify -Xcomp -XX:-TieredCompilation -XX:+ValueArrayFlatten -Xbootclasspath/a:. -XX:+UnlockDiagnosticVMOptions -XX:+WhiteBoxAPI ValueTypeDensity
  */
 
 public class ValueTypeDensity {
--- old/test/runtime/valhalla/valuetypes/ValueTypeGetField.java	2017-03-15 08:54:49.752842063 +0100
+++ new/test/runtime/valhalla/valuetypes/ValueTypeGetField.java	2017-03-15 08:54:49.684842066 +0100
@@ -7,6 +7,7 @@
  * @summary Value Type get field test
  * @library /testlibrary /
  * @run main/othervm -noverify -Xint runtime.valhalla.valuetypes.ValueTypeGetField
+ * @run main/othervm -noverify -Xcomp -XX:-TieredCompilation runtime.valhalla.valuetypes.ValueTypeGetField
  */
 public class ValueTypeGetField {
 
--- old/test/runtime/valhalla/valuetypes/VboxUnbox.java	2017-03-15 08:54:50.008842051 +0100
+++ new/test/runtime/valhalla/valuetypes/VboxUnbox.java	2017-03-15 08:54:49.940842054 +0100
@@ -33,6 +33,7 @@
  * @library /testlibrary /
  * @build runtime.valhalla.valuetypes.ValueCapableClass
  * @run main/othervm -Xint -noverify runtime.valhalla.valuetypes.VboxUnbox
+ * @run main/othervm -Xcomp -XX:-TieredCompilation -noverify runtime.valhalla.valuetypes.VboxUnbox
  *
  * To dump generated byte-code, add "-Dvalhalla.dumpIsolatedMethodClasses=/tmp/foo"
  */



More information about the valhalla-dev mailing list