RFR 8038418 New tests development for type profiling and speculation
Pavel Punegov
pavel.punegov at oracle.com
Wed Apr 9 10:55:31 UTC 2014
Roland,
On Wed, 09 of Apr 2014 11:52:54 Roland Westrelin wrote:
> Hi Pavel,
>
>> Webrev: http://cr.openjdk.java.net/~iignatyev/ppunegov/8038418/webrev.01/
>
> As I understand, with that code:
>
> 67 public Integer run(T obj) {
> 68 if (isReturnType) {
> 69 obj = collectReturnType(obj);
> 70 }
> 71 return inlinee(obj);
> 72 }
>
> it is expected that the compiler has profiling for incoming parameters to
> run(), return from collectReturnType(), arguments at call to inlinee().
Yep. Most of scenarios try to use all three types of type profiling, and I
expect that collectReturnType(obj) will give us return profiling data.
> Because, it knowns from the parameter the profiled type of obj, the compiler
> doesn’t use return value profiling or argument profiling. So I don’t think
> the tests exercise arguments/return value profiling.
But what if the collectReturnType(obj) will change the obj inside the method?
E.g. before it was a TypeHierarchy.B, but became a TypeHierarchy. I thought
that it should use return type profiling for this case:
obj = collectReturnType(obj);
return inlinee(obj);
> One way to test each
> one would be to run with different values of TypeProfileLevel (200, 020,
> 002) or the scenarios/tests would need to be changed so that you can
> pollute parameter profiling + return value profiling but not argument
> profiling etc.
>
> Also with this:
>
> 68 if (isReturnType) {
> 69 obj = collectReturnType(obj);
> 70 }
>
>
> return value profiling is only valid within the if() so it can’t be used be
> the compiler. Something like this:
but why does compiler not eliminate if() when isReturnType == true and is a
final field?
> if (isReturnType) {
> obj = collectReturnType(obj);
> return inlinee(obj);
> }
> return inlinee(obj);
>
> is better.
If it helps, then I'll change test scenarios to have the same code inside the
if() as in the outside.
--
Thanks,
Pavel Punegov
More information about the hotspot-compiler-dev
mailing list