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

Unified Diff: src/stub-cache.cc

Issue 390323002: Remove JSReceiver::GetPrototype and replace it with PrototypeIterator calls (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/runtime.cc ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: src/stub-cache.cc
diff --git a/src/stub-cache.cc b/src/stub-cache.cc
index 2a3d5c301ee9ad077967065c1cf01aede0e8eeac..0c9f4512326eaef114b11cbbf97b7564d5bdeea2 100644
--- a/src/stub-cache.cc
+++ b/src/stub-cache.cc
@@ -700,8 +700,9 @@ void StubCompiler::LookupPostInterceptor(Handle<JSObject> holder,
LookupResult* lookup) {
holder->LookupOwnRealNamedProperty(name, lookup);
if (lookup->IsFound()) return;
- if (holder->GetPrototype()->IsNull()) return;
- holder->GetPrototype()->Lookup(name, lookup);
+ PrototypeIterator iter(holder->GetIsolate(), holder);
+ if (iter.IsAtEnd()) return;
+ PrototypeIterator::GetCurrent(iter)->Lookup(name, lookup);
}
@@ -971,17 +972,18 @@ Handle<Code> StoreStubCompiler::CompileStoreTransition(
__ CheckMapDeprecated(transition, scratch1(), &miss);
// Check that we are allowed to write this.
- if (object->GetPrototype()->IsJSObject()) {
+ PrototypeIterator iter(object->GetIsolate(), object);
+ if (!iter.IsAtEnd()) {
Handle<JSObject> holder;
// holder == object indicates that no property was found.
if (lookup->holder() != *object) {
holder = Handle<JSObject>(lookup->holder());
} else {
// Find the top object.
- holder = object;
do {
- holder = Handle<JSObject>(JSObject::cast(holder->GetPrototype()));
- } while (holder->GetPrototype()->IsJSObject());
+ holder = Handle<JSObject>::cast(PrototypeIterator::GetCurrent(iter));
+ iter.Advance();
+ } while (!iter.IsAtEnd());
}
Register holder_reg = HandlerFrontendHeader(
« no previous file with comments | « src/runtime.cc ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698