RFR(S): type system fix

Tobias Hartmann tobias.hartmann at oracle.com
Tue Jun 5 08:38:30 UTC 2018


Hi Roland,

On 05.06.2018 09:53, Roland Westrelin wrote:
> http://cr.openjdk.java.net/~roland/valhalla/lworld-typesystem-fix/webrev.00/

This looks good to me! Please fix the indentation/whitespacing in type.cpp:4176.

> This allows a test that I added for copyOf to run correctly. The change
> attempts to mirror the logic for instances. I tried to run our tests
> without the workaround in Type::meet_helper() and I hit no failure.

I've just tried to execute our tests but even without your changes I get this failure:

#  Internal Error (/oracle/valhallaL/open/src/hotspot/share/opto/graphKit.cpp:1802), pid=13876,
tid=13890
#  assert(arg->bottom_type()->remove_speculative() == TypePtr::NULL_PTR) failed: Anything other than
null?

Current CompileTask:
C2:   1749  115    b        compiler.valhalla.valuetypes.TestArrays::verify (46 bytes)

Stack: [0x00007fdc1817b000,0x00007fdc1827c000],  sp=0x00007fdc182785d0,  free space=1013k
Native frames: (J=compiled Java code, A=aot compiled Java code, j=interpreted, Vv=VM code, C=native
code)
V  [libjvm.so+0x1a35d6c]  VMError::report_and_die(int, char const*, char const*, __va_list_tag*,
Thread*, unsigned char*, void*, void*, char const*, int, unsigned long)+0x18c
V  [libjvm.so+0x1a36c9f]  VMError::report_and_die(Thread*, void*, char const*, int, char const*,
char const*, __va_list_tag*)+0x2f
V  [libjvm.so+0xbb8faa]  report_vm_error(char const*, int, char const*, char const*, ...)+0x12a
V  [libjvm.so+0xec6f8d]  GraphKit::set_arguments_for_java_call(CallJavaNode*)+0x3bd
V  [libjvm.so+0x8e9c45]  DirectCallGenerator::generate(JVMState*)+0x475
V  [libjvm.so+0xcbb69e]  Parse::do_call()+0x49e
V  [libjvm.so+0x16bb022]  Parse::do_one_bytecode()+0x1c52
V  [libjvm.so+0x16a9cba]  Parse::do_one_block()+0x39a
V  [libjvm.so+0x16aa8d1]  Parse::do_all_blocks()+0x1d1
V  [libjvm.so+0x16ae347]  Parse::Parse(JVMState*, ciMethod*, float)+0xd17
V  [libjvm.so+0x8e560c]  ParseGenerator::generate(JVMState*)+0x1fc
V  [libjvm.so+0xb12f67]  Compile::Compile(ciEnv*, C2Compiler*, ciMethod*, int, bool, bool, bool,
DirectiveSet*)+0xfe7
V  [libjvm.so+0x8e36f2]  C2Compiler::compile_method(ciEnv*, ciMethod*, int, DirectiveSet*)+0x302

The assert triggers because arg is a CheckCastPP:

 146	CastPP	===  145  137  [[ 168  155  155  164 ]]  #java/lang/Object:NotNull *
Oop:java/lang/Object:NotNull * !jvms: TestArrays::verify @ bci:11
 162	IfTrue	===  161  [[ 139  164 ]] #1 !jvms: TestArrays::verify @ bci:11
 164	CheckCastPP	===  162  146  [[ 140  90 ]]  #compiler/valhalla/valuetypes/MyValue2:NotNull:exact
*  Oop:compiler/valhalla/valuetypes/MyValue2:NotNull:exact * !jvms: TestArrays::verify @ bci:11

I think it's too strong, here's the fix:

--- a/src/hotspot/share/opto/graphKit.cpp	Mon Jun 04 16:49:10 2018 +0200
+++ b/src/hotspot/share/opto/graphKit.cpp	Tue Jun 05 10:25:52 2018 +0200
@@ -1797,9 +1797,8 @@
         // Pass value type argument via oop to callee
         arg = vt->allocate(this)->get_oop();
       }
-    } else if (t->is_valuetypeptr()) {
+    } else if (t->is_valuetypeptr() && arg->bottom_type()->remove_speculative() == TypePtr::NULL_PTR) {
       // Constant null passed for a value type argument
-      assert(arg->bottom_type()->remove_speculative() == TypePtr::NULL_PTR, "Anything other than
null?");

With that and your fix, all tests pass on my machine as well.

Thanks,
Tobias



More information about the valhalla-dev mailing list