review (S) for 6442502
Vladimir.Kozlov at Sun.COM
Wed Feb 4 19:17:38 PST 2009
Actually all ptr types will produce the same zerocon
since all have the same zero_type:
_zero_type[T_OBJECT] = TypePtr::NULL_PTR;
_zero_type[T_ARRAY] = TypePtr::NULL_PTR; // null array is null oop
_zero_type[T_ADDRESS] = TypePtr::NULL_PTR; // raw pointers use the same null
So you are right, you can use null().
Tom Rodriguez wrote:
> There's only one kind of NULL in the type system and that's
> TypePtr::NULL_PTR which is what null() returns for every kind of
> pointer. It seems obfuscating to use something other than null() in
> that case doesn't it?
> On Feb 4, 2009, at 6:19 PM, Vladimir Kozlov wrote:
>> null() is defined as zerocon(T_OBJECT) but
>> basic type for TypeRawPtr is T_ADDRESS.
>> To be consistent use zerocon(T_ADDRESS) instead of null().
>> Tom Rodriguez wrote:
More information about the hotspot-compiler-dev