Upstream version 10.39.233.0
[platform/framework/web/crosswalk.git] / src / v8 / src / hydrogen-types.cc
index 87047a2..85dc53c 100644 (file)
@@ -5,6 +5,7 @@
 #include "src/hydrogen-types.h"
 
 #include "src/ostreams.h"
+#include "src/property-details.h"
 #include "src/types-inl.h"
 
 
@@ -46,6 +47,9 @@ HType HType::FromValue(Handle<Object> value) {
     double n = Handle<v8::internal::HeapNumber>::cast(value)->value();
     return IsSmiDouble(n) ? HType::Smi() : HType::HeapNumber();
   }
+  if (value->IsFloat32x4()) return HType::Float32x4();
+  if (value->IsFloat64x2()) return HType::Float64x2();
+  if (value->IsInt32x4()) return HType::Int32x4();
   if (value->IsString()) return HType::String();
   if (value->IsBoolean()) return HType::Boolean();
   if (value->IsUndefined()) return HType::Undefined();
@@ -56,6 +60,24 @@ 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_-|: