Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(229)

Unified Diff: src/crankshaft/hydrogen-types.cc

Issue 1636013002: Replace HeapType with a non-templated FieldType class. (Closed) Base URL: https://chromium.googlesource.com/v8/v8.git@master
Patch Set: Fix tracing of generalizations Created 4 years, 11 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
Index: src/crankshaft/hydrogen-types.cc
diff --git a/src/crankshaft/hydrogen-types.cc b/src/crankshaft/hydrogen-types.cc
index 9c5e34194ee385e708e7f58bc958f2fee7718114..4c640de31c4605ce19569020fc23463bfe14f9c3 100644
--- a/src/crankshaft/hydrogen-types.cc
+++ b/src/crankshaft/hydrogen-types.cc
@@ -12,31 +12,25 @@ namespace v8 {
namespace internal {
// static
-template <class T>
-HType HType::FromType(typename T::TypeHandle type) {
- if (T::Any()->Is(type)) return HType::Any();
+HType HType::FromType(Type* type) {
+ if (Type::Any()->Is(type)) return HType::Any();
if (!type->IsInhabited()) return HType::None();
- if (type->Is(T::SignedSmall())) return HType::Smi();
- if (type->Is(T::Number())) return HType::TaggedNumber();
- if (type->Is(T::Null())) return HType::Null();
- if (type->Is(T::String())) return HType::String();
- if (type->Is(T::Boolean())) return HType::Boolean();
- if (type->Is(T::Undefined())) return HType::Undefined();
- if (type->Is(T::Object())) return HType::JSObject();
- if (type->Is(T::Receiver())) return HType::JSReceiver();
+ if (type->Is(Type::SignedSmall())) return HType::Smi();
+ if (type->Is(Type::Number())) return HType::TaggedNumber();
+ if (type->Is(Type::Null())) return HType::Null();
+ if (type->Is(Type::String())) return HType::String();
+ if (type->Is(Type::Boolean())) return HType::Boolean();
+ if (type->Is(Type::Undefined())) return HType::Undefined();
+ if (type->Is(Type::Object())) return HType::JSObject();
+ if (type->Is(Type::Receiver())) return HType::JSReceiver();
return HType::Tagged();
}
// static
-template
-HType HType::FromType<Type>(Type* type);
-
-
-// static
-template
-HType HType::FromType<HeapType>(Handle<HeapType> type);
-
+HType HType::FromFieldType(Handle<FieldType> type, Zone* temp_zone) {
Benedikt Meurer 2016/01/26 14:22:47 Can we have a TODO here to remember to clean this
Jarin 2016/01/26 14:30:41 As discussed offline, it is not clear what can be
+ return FromType(type->Convert(temp_zone));
+}
// static
HType HType::FromValue(Handle<Object> value) {

Powered by Google App Engine
This is Rietveld 408576698