Uploaded image for project: 'JDK'
  1. JDK
  2. JDK-8183920

[MVT] Arraycopy and clone intrinsics do not work with value type arrays

XMLWordPrintable

      We should fix the intrinsics and add the following tests:
          
          @Test()
          public MyValue1[] test59(MyValue1[] va) {
              return va.clone();
          }

          @DontCompile
          public void test59_verifier(boolean warmup) {
              int len = Math.abs(rI) % 10;
              MyValue1[] va = new MyValue1[len];
              for (int i = 0; i < len; ++i) {
                  va[i] = MyValue1.createInline(rI, rL);
              }
              MyValue1[] result = test59(va);
              for (int i = 0; i < len; ++i) {
                  Asserts.assertEQ(result[i].hash(), va[i].hash());
              }
          }

          @Test()
          public void test60(MyValue1[] src, MyValue1[] dst) {
              System.arraycopy(src, 0, dst, 0, src.length);
          }

          @DontCompile
          public void test60_verifier(boolean warmup) {
              int len = Math.abs(rI) % 10;
              MyValue1[] src = new MyValue1[len];
              MyValue1[] dst = new MyValue1[len];
              for (int i = 0; i < len; ++i) {
                  src[i] = MyValue1.createInline(rI, rL);
              }
              test60(src, dst);
              for (int i = 0; i < len; ++i) {
                  Asserts.assertEQ(src[i].hash(), dst[i].hash());
              }
          }

            roland Roland Westrelin
            thartmann Tobias Hartmann
            Votes:
            0 Vote for this issue
            Watchers:
            2 Start watching this issue

              Created:
              Updated:
              Resolved: