Index: src/types.cc |
diff --git a/src/types.cc b/src/types.cc |
index 1275deacb744e7b2f60485e6c0deaa9005f1fc59..d39a22e34d2f421e8c449ba4def0cb5c8a9b40fa 100644 |
--- a/src/types.cc |
+++ b/src/types.cc |
@@ -476,4 +476,13 @@ Type* Type::Optional(Handle<Type> type) { |
: Union(type, Undefined()->handle_via_isolate_of(*type)); |
} |
+ |
+Representation Representation::FromType(Handle<Type> type) { |
+ if (type->Is(Type::None())) return Representation::None(); |
+ if (type->Is(Type::Signed32())) return Representation::Integer32(); |
+ if (type->Is(Type::Number())) return Representation::Double(); |
+ return Representation::Tagged(); |
+} |
+ |
+ |
} } // namespace v8::internal |