Upstream version 9.38.207.0
[platform/framework/web/crosswalk.git] / src / v8 / src / hydrogen-types.cc
index c83ff3c..a14a523 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"
 
 
@@ -43,6 +44,9 @@ 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->IsString()) return HType::String();
   if (value->IsBoolean()) return HType::Boolean();
   if (value->IsUndefined()) return HType::Undefined();
@@ -53,6 +57,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_-|: