Reviewers: Toon Verwaest,

Description:
Simplify prototype chain walk in hydrogen

Since we know that we're only encountering JSObjects, we can use the
faster GetPrototype() method to walk up the chain

BUG=none
[email protected]
LOG=n

Please review this at https://codereview.chromium.org/321543002/

SVN Base: https://v8.googlecode.com/svn/branches/bleeding_edge

Affected files (+3, -4 lines):
  M src/hydrogen.cc


Index: src/hydrogen.cc
diff --git a/src/hydrogen.cc b/src/hydrogen.cc
index a3f4b0b2a53d80ca7d2742590712a014cb141c8e..1e623afc81fa7eba25ecef8081b850efd70f672f 100644
--- a/src/hydrogen.cc
+++ b/src/hydrogen.cc
@@ -6558,11 +6558,10 @@ HInstruction* HOptimizedGraphBuilder::BuildMonomorphicElementAccess(
     // changes could allow callbacks on elements in the chain that
     // aren't compatible with monomorphic keyed stores.
     Handle<JSObject> prototype(JSObject::cast(map->prototype()));
-    Object* holder = map->prototype();
-    while (holder->GetPrototype(isolate())->IsJSObject()) {
-      holder = holder->GetPrototype(isolate());
+    JSObject* holder = JSObject::cast(map->prototype());
+    while (!holder->GetPrototype()->IsNull()) {
+      holder = JSObject::cast(holder->GetPrototype());
     }
-    ASSERT(holder->GetPrototype(isolate())->IsNull());

     BuildCheckPrototypeMaps(prototype,
                             Handle<JSObject>(JSObject::cast(holder)));


--
--
v8-dev mailing list
[email protected]
http://groups.google.com/group/v8-dev
--- You received this message because you are subscribed to the Google Groups "v8-dev" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to [email protected].
For more options, visit https://groups.google.com/d/optout.

Reply via email to