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

Unified Diff: src/ic.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/ia32/stub-cache-ia32.cc ('k') | src/ic.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: src/ic.h
diff --git a/src/ic.h b/src/ic.h
index 3f5a25658b79dc29d82c96235dd37d749c29ab8c..7113b0b5121918a6b3d04694b422e67c0a63fe79 100644
--- a/src/ic.h
+++ b/src/ic.h
@@ -148,11 +148,24 @@ class IC {
Object* object,
InlineCacheHolderFlag holder);
+ static inline InlineCacheHolderFlag GetCodeCacheFlag(Type* type);
+ static inline Handle<Map> GetCodeCacheHolder(InlineCacheHolderFlag flag,
+ Type* type,
+ Isolate* isolate);
+
static bool IsCleared(Code* code) {
InlineCacheState state = code->ic_state();
return state == UNINITIALIZED || state == PREMONOMORPHIC;
}
+ // Utility functions to convert maps to types and back. There are two special
+ // cases:
+ // - The heap_number_map is used as a marker which includes heap numbers as
+ // well as smis.
+ // - The oddball map is only used for booleans.
+ static Handle<Map> TypeToMap(Type* type, Isolate* isolate);
+ static Type* MapToType(Handle<Map> type);
+
protected:
// Get the call-site target; used for determining the state.
Handle<Code> target() const { return target_; }
@@ -204,20 +217,22 @@ class IC {
UNREACHABLE();
return Handle<Code>::null();
}
- void UpdateMonomorphicIC(Handle<Object> receiver,
+
+ void UpdateMonomorphicIC(Handle<Type> type,
Handle<Code> handler,
Handle<String> name);
- bool UpdatePolymorphicIC(Handle<Object> receiver,
+ bool UpdatePolymorphicIC(Handle<Type> type,
Handle<String> name,
Handle<Code> code);
+ virtual void UpdateMegamorphicCache(Type* type, Name* name, Code* code);
+
void CopyICToMegamorphicCache(Handle<String> name);
- bool IsTransitionedMapOfMonomorphicTarget(Map* receiver_map);
- void PatchCache(Handle<Object> object,
+ bool IsTransitionOfMonomorphicTarget(Type* type);
+ void PatchCache(Handle<Type> type,
Handle<String> name,
Handle<Code> code);
- virtual void UpdateMegamorphicCache(Map* map, Name* name, Code* code);
virtual Code::Kind kind() const {
UNREACHABLE();
return Code::STUB;
@@ -512,7 +527,7 @@ class KeyedLoadIC: public LoadIC {
return isolate()->builtins()->KeyedLoadIC_Slow();
}
- virtual void UpdateMegamorphicCache(Map* map, Name* name, Code* code) { }
+ virtual void UpdateMegamorphicCache(Type* type, Name* name, Code* code) { }
private:
// Stub accessors.
@@ -693,7 +708,7 @@ class KeyedStoreIC: public StoreIC {
protected:
virtual Code::Kind kind() const { return Code::KEYED_STORE_IC; }
- virtual void UpdateMegamorphicCache(Map* map, Name* name, Code* code) { }
+ virtual void UpdateMegamorphicCache(Type* type, Name* name, Code* code) { }
virtual Handle<Code> pre_monomorphic_stub() {
return pre_monomorphic_stub(isolate(), strict_mode());
« no previous file with comments | « src/ia32/stub-cache-ia32.cc ('k') | src/ic.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698