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

Unified Diff: src/objects.cc

Issue 400523007: Cache IC handlers on the prototype's map if possible (Closed) Base URL: https://v8.googlecode.com/svn/branches/bleeding_edge
Patch Set: addressed comment Created 6 years, 5 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/objects.h ('k') | src/objects-inl.h » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: src/objects.cc
diff --git a/src/objects.cc b/src/objects.cc
index 43288ad810ef79ddaeee3b7e9e0e2a26d9a2915f..8f61f756493b3e99b930f1199c0cb00cbb72b558 100644
--- a/src/objects.cc
+++ b/src/objects.cc
@@ -10891,6 +10891,26 @@ bool Code::FindHandlers(CodeHandleList* code_list, int length) {
}
+MaybeHandle<Code> Code::FindHandlerForMap(Map* map) {
+ ASSERT(is_inline_cache_stub());
+ int mask = RelocInfo::ModeMask(RelocInfo::CODE_TARGET) |
+ RelocInfo::ModeMask(RelocInfo::EMBEDDED_OBJECT);
+ bool return_next = false;
+ for (RelocIterator it(this, mask); !it.done(); it.next()) {
+ RelocInfo* info = it.rinfo();
+ if (info->rmode() == RelocInfo::EMBEDDED_OBJECT) {
+ Object* object = info->target_object();
+ if (object == map) return_next = true;
+ } else if (return_next) {
+ Code* code = Code::GetCodeFromTargetAddress(info->target_address());
+ ASSERT(code->kind() == Code::HANDLER);
+ return handle(code);
+ }
+ }
+ return MaybeHandle<Code>();
+}
+
+
Name* Code::FindFirstName() {
ASSERT(is_inline_cache_stub());
DisallowHeapAllocation no_allocation;
@@ -11354,7 +11374,8 @@ const char* Code::ICState2String(InlineCacheState state) {
case UNINITIALIZED: return "UNINITIALIZED";
case PREMONOMORPHIC: return "PREMONOMORPHIC";
case MONOMORPHIC: return "MONOMORPHIC";
- case MONOMORPHIC_PROTOTYPE_FAILURE: return "MONOMORPHIC_PROTOTYPE_FAILURE";
+ case PROTOTYPE_FAILURE:
+ return "PROTOTYPE_FAILURE";
case POLYMORPHIC: return "POLYMORPHIC";
case MEGAMORPHIC: return "MEGAMORPHIC";
case GENERIC: return "GENERIC";
« no previous file with comments | « src/objects.h ('k') | src/objects-inl.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698