Upstream version 10.39.225.0
[platform/framework/web/crosswalk.git] / src / v8 / src / hydrogen-types.cc
index a14a523..87047a2 100644 (file)
@@ -5,7 +5,6 @@
 #include "src/hydrogen-types.h"
 
 #include "src/ostreams.h"
-#include "src/property-details.h"
 #include "src/types-inl.h"
 
 
@@ -43,10 +42,10 @@ HType HType::FromType<HeapType>(Handle<HeapType> type);
 HType HType::FromValue(Handle<Object> value) {
   if (value->IsSmi()) return HType::Smi();
   if (value->IsNull()) return HType::Null();
-  if (value->IsHeapNumber()) return HType::HeapNumber();
-  if (value->IsFloat32x4()) return HType::Float32x4();
-  if (value->IsFloat64x2()) return HType::Float64x2();
-  if (value->IsInt32x4()) return HType::Int32x4();
+  if (value->IsHeapNumber()) {
+    double n = Handle<v8::internal::HeapNumber>::cast(value)->value();
+    return IsSmiDouble(n) ? HType::Smi() : HType::HeapNumber();
+  }
   if (value->IsString()) return HType::String();
   if (value->IsBoolean()) return HType::Boolean();
   if (value->IsUndefined()) return HType::Undefined();
@@ -57,24 +56,6 @@ HType HType::FromValue(Handle<Object> value) {
 }
 
 
-// static
-HType HType::FromRepresentation(Representation representation) {
-  HType result = HType::Tagged();
-  if (representation.IsSmi()) {
-    result = HType::Smi();
-  } else if (representation.IsDouble()) {
-    result = HType::HeapNumber();
-  } else if (representation.IsFloat32x4()) {
-    result = HType::Float32x4();
-  } else if (representation.IsFloat64x2()) {
-    result = HType::Float64x2();
-  } else if (representation.IsInt32x4()) {
-    result = HType::Int32x4();
-  }
-  return result;
-}
-
-
 OStream& operator<<(OStream& os, const HType& t) {
   // Note: The c1visualizer syntax for locals allows only a sequence of the
   // following characters: A-Za-z0-9_-|: