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

Unified Diff: src/ic-inl.h

Issue 376233002: Introduce a PrototypeIterator class and use it for prototype access (Closed) Base URL: https://v8.googlecode.com/svn/branches/bleeding_edge
Patch Set: updates 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/ic.cc ('k') | src/isolate.cc » ('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 a26d31b63598ab9729c9050826b0e05c64196361..78d42ea9c3e7d4d34f0e6c982eed00f321fd5e38 100644
--- a/src/ic-inl.h
+++ b/src/ic-inl.h
@@ -10,6 +10,7 @@
#include "src/compiler.h"
#include "src/debug.h"
#include "src/macro-assembler.h"
+#include "src/prototype.h"
namespace v8 {
namespace internal {
@@ -132,9 +133,11 @@ HeapObject* IC::GetCodeCacheHolder(Isolate* isolate,
Object* object,
InlineCacheHolderFlag holder) {
if (object->IsSmi()) holder = PROTOTYPE_MAP;
- Object* map_owner = holder == OWN_MAP
- ? object : object->GetPrototype(isolate);
- return HeapObject::cast(map_owner);
+ PrototypeIterator iter(isolate, object,
+ holder == OWN_MAP
+ ? PrototypeIterator::START_AT_RECEIVER
+ : PrototypeIterator::START_AT_PROTOTYPE);
+ return HeapObject::cast(iter.GetCurrent());
}
« no previous file with comments | « src/ic.cc ('k') | src/isolate.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698