Chromium Code Reviews| Index: src/ic.h |
| diff --git a/src/ic.h b/src/ic.h |
| index 54fd1eb19ad64767137ab7ff3372f700d25d4d1f..6521c086fef991f8af4d2bd3cf4004af23d23aca 100644 |
| --- a/src/ic.h |
| +++ b/src/ic.h |
| @@ -139,9 +139,21 @@ class IC { |
| // well as smis. |
| // - The oddball map is only used for booleans. |
| static Handle<Map> TypeToMap(HeapType* type, Isolate* isolate); |
| - static Handle<HeapType> MapToType(Handle<Map> map); |
| - static Handle<HeapType> CurrentTypeOf( |
| - Handle<Object> object, Isolate* isolate); |
| + template<class T> |
|
rossberg
2014/02/03 16:54:05
Same here.
|
| + static typename T::TypeHandle MapToType(Handle<Map> map, |
| + typename T::Region* region) { |
| + if (map->instance_type() == HEAP_NUMBER_TYPE) { |
| + return T::Number(region); |
| + } else if (map->instance_type() == ODDBALL_TYPE) { |
| + // The only oddballs that can be recorded in ICs are booleans. |
| + return T::Boolean(region); |
| + } else { |
| + return T::Class(map, region); |
| + } |
| + } |
| + |
| + static Handle<HeapType> CurrentTypeOf(Handle<Object> object, |
| + Isolate* isolate); |
| protected: |
| // Get the call-site target; used for determining the state. |