RFR (L, tedious again, sorry) 8189610: Reconcile jvm.h and all jvm_md.h between java.base and hotspot

coleen.phillimore at oracle.com coleen.phillimore at oracle.com
Fri Oct 27 15:13:57 UTC 2017



On 10/27/17 9:37 AM, David Holmes wrote:
>>> src/hotspot/share/c1/c1_LinearScan.cpp
>>>
>>>  ConstantIntValue((jint)0);
>>>
>>> why is this cast needed? what causes the ambiguity? (If this was a 
>>> template I'd understand ;-) ). Also didn't you change that 
>>> constructor to take an int anyway - not that I think it should - see 
>>> below.
>>
>> Yes, it caused an ambiguity.  0 matches 'int' but it doesn't match 
>> 'long' better than any pointer type.  So this cast is needed.
>
> But you changed the constructor to take an int!
>
>  class ConstantIntValue: public ScopeValue {
>   private:
> -  jint _value;
> +  int _value;
>   public:
> -  ConstantIntValue(jint value)         { _value = value; }
> +  ConstantIntValue(int value)          { _value = value; }
>
I changed this back to not take an int and changed c1_LinearScan.cpp to 
have the (jint)0 cast and output.cp needed (jint)0 casts.  0L doesn't 
work for platforms where jint is an 'int' rather than a long because 
it's ambiguous with the functions that take a pointer type.
Probably better to keep the type of ConstantIntValue consistent with j 
types.

Thanks,
Coleen



More information about the build-dev mailing list