hg: valhalla/valhalla: [lworld] C2 fixes for crashes with TestMethodHandles.java
Tobias Hartmann
tobias.hartmann at oracle.com
Wed Jun 13 09:45:06 UTC 2018
Hi,
when testing with "-ea -esa -XX:CompileThreshold=100", I found some bugs:
(1) GraphKit::record_profile_for_speculation() tries to improve the type of a ValueTypeNode by
joining with a speculative type. As a result, we get a type system assert because TypeValueType
should not be mixed with TypeOopPtr [1]. I've fixed this by implementing would_improve_type() and
would_improve_ptr() for TypeValueType to return false.
(2) We crash with "assert(arg->is_ValueType()) failed: inconsistent argument" in cast_argument()
when inlining a method handle intrinsic because the argument type is java.lang.Object and the
sig_type is a value type [2]. I've fixed and refactored the code.
http://cr.openjdk.java.net/~thartmann/valhalla/lworld/mh_fixes/
Best regards,
Tobias
[1] Error mixing types: oopptr:TopPTR+top,iid=top (inline_depth=InlineDepthTop)
(speculative=compiler/valhalla/valuetypes/MyValue1:AnyNull:exact *,iid=top (inline_depth=-1))
[narrow] and valuetype[8]:{long, int, int, short, java/lang/Integer, [I,
compiler/valhalla/valuetypes/MyValue2, compiler/valhalla/valuetypes/MyValue2}
[2] arg is 238:
465 ValueTypePtr === _ 414 419 422 425 428 432 436 437 451 [[ 368 ]]
#compiler/valhalla/valuetypes/MyValue1:NotNull:exact *
Oop:compiler/valhalla/valuetypes/MyValue1:NotNull:exact * !jvms: 0x00000008000b5840::invokeStatic @
bci:-1 0x00000008000b6c40::invoke @ bci:14 0x00000008000e2c40::invokeExact_MT @ bci:18
TestMethodHandles::test4 @ bci:3
3 Start === 3 0 [[ 3 5 6 7 8 9 ]] #{0:control, 1:abIO, 2:memory, 3:rawptr:BotPTR,
4:return_address, 5:compiler/valhalla/valuetypes/TestMethodHandles:NotNull *}
368 CheckCastPP === 5 465 [[ 238 ]] #java/lang/Object:NotNull *
(speculative=compiler/valhalla/valuetypes/MyValue1:NotNull:exact * (inline_depth=4))
Oop:java/lang/Object:NotNull * (speculative=compiler/valhalla/valuetypes/MyValue1:NotNull:exact *
(inline_depth=4)) !jvms: 0x00000008000b5840::invokeStatic @ bci:9 0x00000008000b6c40::invoke @
bci:14 0x00000008000e2c40::invokeExact_MT @ bci:18 TestMethodHandles::test4 @ bci:3
5 Parm === 3 [[ 551 238 368 596 ]] Control !orig=[148] !jvms: TestMethodHandles::test4 @ bci:-1
238 CheckCastPP === 5 368 [[ 551 596 ]] #java/lang/Object:NotNull *
(speculative=compiler/valhalla/valuetypes/MyValue1:NotNull:exact * (inline_depth=3))
Oop:java/lang/Object:NotNull * (speculative=compiler/valhalla/valuetypes/MyValue1:NotNull:exact *
(inline_depth=3)) !jvms: 0x00000008000b6c40::invoke @ bci:14 0x00000008000e2c40::invokeExact_MT @
bci:18 TestMethodHandles::test4 @ bci:3
More information about the valhalla-dev
mailing list