From 9110beb7726c1a8ef7ad8e41e517828d1017c239 Mon Sep 17 00:00:00 2001 From: "antonm@chromium.org" Date: Tue, 30 Jun 2009 12:29:45 +0000 Subject: [PATCH] Don't do a second lookup as we have it already. Review URL: http://codereview.chromium.org/149007 git-svn-id: http://v8.googlecode.com/svn/branches/bleeding_edge@2306 ce2b1a6d-e550-0410-aec6-3dcde31c8c00 --- src/ic.cc | 13 ++++--------- 1 file changed, 4 insertions(+), 9 deletions(-) diff --git a/src/ic.cc b/src/ic.cc index 74c37cee3f..9483589479 100644 --- a/src/ic.cc +++ b/src/ic.cc @@ -328,11 +328,11 @@ Object* CallIC::LoadFunction(State state, UpdateCaches(&lookup, state, object, name); } + // Get the property. + PropertyAttributes attr; + result = object->GetProperty(*object, &lookup, *name, &attr); + if (result->IsFailure()) return result; if (lookup.type() == INTERCEPTOR) { - // Get the property. - PropertyAttributes attr; - result = object->GetProperty(*name, &attr); - if (result->IsFailure()) return result; // If the object does not have the requested property, check which // exception we need to throw. if (attr == ABSENT) { @@ -341,11 +341,6 @@ Object* CallIC::LoadFunction(State state, } return TypeError("undefined_method", object, name); } - } else { - // Lookup is valid and no interceptors are involved. Get the - // property. - result = object->GetProperty(*name); - if (result->IsFailure()) return result; } ASSERT(result != Heap::the_hole_value());