src/hotspot/share/metaprogramming/primitiveConversions.hpp
changeset 47609 a1f68e415b48
parent 47216 71c04702a3d5
child 49364 601146c66cad
equal deleted inserted replaced
47608:9d337e48b178 47609:a1f68e415b48
   165 template<typename T, typename U>
   165 template<typename T, typename U>
   166 inline T PrimitiveConversions::cast(U x) {
   166 inline T PrimitiveConversions::cast(U x) {
   167   return Cast<T, U>()(x);
   167   return Cast<T, U>()(x);
   168 }
   168 }
   169 
   169 
       
   170 // jfloat and jdouble translation to integral types
       
   171 
       
   172 template<>
       
   173 struct PrimitiveConversions::Translate<jdouble> : public TrueType {
       
   174   typedef double Value;
       
   175   typedef int64_t Decayed;
       
   176 
       
   177   static Decayed decay(Value x) { return PrimitiveConversions::cast<Decayed>(x); }
       
   178   static Value recover(Decayed x) { return PrimitiveConversions::cast<Value>(x); }
       
   179 };
       
   180 
       
   181 template<>
       
   182 struct PrimitiveConversions::Translate<jfloat> : public TrueType {
       
   183   typedef float Value;
       
   184   typedef int32_t Decayed;
       
   185 
       
   186   static Decayed decay(Value x) { return PrimitiveConversions::cast<Decayed>(x); }
       
   187   static Value recover(Decayed x) { return PrimitiveConversions::cast<Value>(x); }
       
   188 };
       
   189 
   170 #endif // SHARE_VM_METAPROGRAMMING_PRIMITIVECONVERSIONS_HPP
   190 #endif // SHARE_VM_METAPROGRAMMING_PRIMITIVECONVERSIONS_HPP