Index: src/type-info.cc |
diff --git a/src/type-info.cc b/src/type-info.cc |
index 83eb9c45b49932755bcc998d3e4d821828b556da..e2be3aa66db4c0a7089bc5a072be9446fc59107a 100644 |
--- a/src/type-info.cc |
+++ b/src/type-info.cc |
@@ -395,8 +395,7 @@ Handle<Type> TypeFeedbackOracle::UnaryType(TypeFeedbackId id) { |
} |
Handle<Code> code = Handle<Code>::cast(object); |
ASSERT(code->is_unary_op_stub()); |
- return UnaryOpIC::TypeInfoToType( |
- static_cast<UnaryOpIC::TypeInfo>(code->unary_op_type()), isolate()); |
+ return UnaryOpStub(code->extra_ic_state()).GetType(isolate()); |
} |
@@ -698,4 +697,16 @@ void TypeFeedbackOracle::SetInfo(TypeFeedbackId ast_id, Object* target) { |
#endif |
} |
+ |
+Representation Representation::FromType(TypeInfo info) { |
+ if (info.IsUninitialized()) return Representation::None(); |
+ // TODO(verwaest): Return Smi rather than Integer32. |
+ if (info.IsSmi()) return Representation::Integer32(); |
+ if (info.IsInteger32()) return Representation::Integer32(); |
+ if (info.IsDouble()) return Representation::Double(); |
+ if (info.IsNumber()) return Representation::Double(); |
+ return Representation::Tagged(); |
+} |
+ |
+ |
} } // namespace v8::internal |