Index: src/ic/ic-inl.h |
diff --git a/src/ic/ic-inl.h b/src/ic/ic-inl.h |
index 484b3a564cb7216e446d099940de1a33df198e0a..45dd3476cfa7e5d1919a91160dff1804eca7324f 100644 |
--- a/src/ic/ic-inl.h |
+++ b/src/ic/ic-inl.h |
@@ -161,15 +161,15 @@ Code* IC::raw_target() const { |
void IC::UpdateTarget() { target_ = handle(raw_target(), isolate_); } |
-template <class TypeClass> |
-JSFunction* IC::GetRootConstructor(TypeClass* type, Context* native_context) { |
- if (type->Is(TypeClass::Boolean())) { |
+JSFunction* IC::GetRootConstructor(Map* receiver_map, Context* native_context) { |
+ Isolate* isolate = receiver_map->GetIsolate(); |
+ if (receiver_map == isolate->heap()->boolean_map()) { |
return native_context->boolean_function(); |
- } else if (type->Is(TypeClass::Number())) { |
+ } else if (receiver_map->instance_type() == HEAP_NUMBER_TYPE) { |
return native_context->number_function(); |
- } else if (type->Is(TypeClass::String())) { |
+ } else if (receiver_map->instance_type() < FIRST_NONSTRING_TYPE) { |
return native_context->string_function(); |
- } else if (type->Is(TypeClass::Symbol())) { |
+ } else if (receiver_map->instance_type() == SYMBOL_TYPE) { |
return native_context->symbol_function(); |
} else { |
return NULL; |
@@ -177,15 +177,15 @@ JSFunction* IC::GetRootConstructor(TypeClass* type, Context* native_context) { |
} |
-Handle<Map> IC::GetHandlerCacheHolder(HeapType* type, bool receiver_is_holder, |
- Isolate* isolate, CacheHolderFlag* flag) { |
- Handle<Map> receiver_map = TypeToMap(type, isolate); |
+Handle<Map> IC::GetHandlerCacheHolder(Handle<Map> receiver_map, |
+ bool receiver_is_holder, Isolate* isolate, |
+ CacheHolderFlag* flag) { |
if (receiver_is_holder) { |
*flag = kCacheOnReceiver; |
return receiver_map; |
} |
Context* native_context = *isolate->native_context(); |
- JSFunction* builtin_ctor = GetRootConstructor(type, native_context); |
+ JSFunction* builtin_ctor = GetRootConstructor(*receiver_map, native_context); |
if (builtin_ctor != NULL) { |
*flag = kCacheOnPrototypeReceiverIsPrimitive; |
return handle(HeapObject::cast(builtin_ctor->instance_prototype())->map()); |
@@ -198,16 +198,16 @@ Handle<Map> IC::GetHandlerCacheHolder(HeapType* type, bool receiver_is_holder, |
} |
-Handle<Map> IC::GetICCacheHolder(HeapType* type, Isolate* isolate, |
+Handle<Map> IC::GetICCacheHolder(Handle<Map> map, Isolate* isolate, |
CacheHolderFlag* flag) { |
Context* native_context = *isolate->native_context(); |
- JSFunction* builtin_ctor = GetRootConstructor(type, native_context); |
+ JSFunction* builtin_ctor = GetRootConstructor(*map, native_context); |
if (builtin_ctor != NULL) { |
*flag = kCacheOnPrototype; |
return handle(builtin_ctor->initial_map()); |
} |
*flag = kCacheOnReceiver; |
- return TypeToMap(type, isolate); |
+ return map; |
} |