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

Unified Diff: src/ic/ic-inl.h

Issue 935603002: Stop using HeapType in IC and Crankshaft (Closed) Base URL: https://chromium.googlesource.com/v8/v8.git@master
Patch Set: Created 5 years, 10 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
« no previous file with comments | « src/ic/ic-compiler.cc ('k') | src/ic/x64/handler-compiler-x64.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
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;
}
« no previous file with comments | « src/ic/ic-compiler.cc ('k') | src/ic/x64/handler-compiler-x64.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698