From b056a8d6c7054f60f725bb96183fafcbae694c46 Mon Sep 17 00:00:00 2001 From: "jochen@chromium.org" Date: Fri, 6 Jun 2014 13:33:27 +0000 Subject: [PATCH] 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 R=verwaest@chromium.org LOG=n Review URL: https://codereview.chromium.org/321543002 git-svn-id: https://v8.googlecode.com/svn/branches/bleeding_edge@21718 ce2b1a6d-e550-0410-aec6-3dcde31c8c00 --- src/hydrogen.cc | 7 +++---- 1 file changed, 3 insertions(+), 4 deletions(-) diff --git a/src/hydrogen.cc b/src/hydrogen.cc index a3f4b0b..1e623af 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 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::cast(holder))); -- 2.7.4