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

Unified Diff: src/ic-inl.h

Issue 75413002: Convert PatchCache (and related methods) to use types rather than objects/maps. (Closed) Base URL: https://v8.googlecode.com/svn/branches/bleeding_edge
Patch Set: Addressed comment Created 7 years, 1 month 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.cc ('k') | src/list.h » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: src/ic-inl.h
diff --git a/src/ic-inl.h b/src/ic-inl.h
index d1c31c0c8f3227e4afab1771daeed4ed7a803033..bd45c3e99d8a19a7778a6ef7439f4e4b18944ad9 100644
--- a/src/ic-inl.h
+++ b/src/ic-inl.h
@@ -120,6 +120,39 @@ HeapObject* IC::GetCodeCacheHolder(Isolate* isolate,
}
+InlineCacheHolderFlag IC::GetCodeCacheFlag(Type* type) {
+ if (type->Is(Type::Boolean()) ||
+ type->Is(Type::Number()) ||
+ type->Is(Type::String()) ||
+ type->Is(Type::Symbol())) {
+ return PROTOTYPE_MAP;
+ }
+ return OWN_MAP;
+}
+
+
+Handle<Map> IC::GetCodeCacheHolder(InlineCacheHolderFlag flag,
+ Type* type,
+ Isolate* isolate) {
+ if (flag == PROTOTYPE_MAP) {
+ Context* context = isolate->context()->native_context();
+ JSFunction* constructor;
+ if (type->Is(Type::Boolean())) {
+ constructor = context->boolean_function();
+ } else if (type->Is(Type::Number())) {
+ constructor = context->number_function();
+ } else if (type->Is(Type::String())) {
+ constructor = context->string_function();
+ } else {
+ ASSERT(type->Is(Type::Symbol()));
+ constructor = context->symbol_function();
+ }
+ return handle(JSObject::cast(constructor->instance_prototype())->map());
+ }
+ return type->AsClass();
+}
+
+
} } // namespace v8::internal
#endif // V8_IC_INL_H_
« no previous file with comments | « src/ic.cc ('k') | src/list.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698