From ea1dc8eeef05465dc892d2211236012e8d3b71f1 Mon Sep 17 00:00:00 2001 From: "yangguo@chromium.org" Date: Wed, 9 Apr 2014 13:05:56 +0000 Subject: [PATCH] Remove uses of non-handlified GetProperty. R=ishell@chromium.org Review URL: https://codereview.chromium.org/229373007 git-svn-id: http://v8.googlecode.com/svn/branches/bleeding_edge@20619 ce2b1a6d-e550-0410-aec6-3dcde31c8c00 --- src/objects-inl.h | 5 ----- src/objects.cc | 35 +++++++++++------------------------ src/objects.h | 7 ------- 3 files changed, 11 insertions(+), 36 deletions(-) diff --git a/src/objects-inl.h b/src/objects-inl.h index b72180db38..cedd6f4348 100644 --- a/src/objects-inl.h +++ b/src/objects-inl.h @@ -1108,11 +1108,6 @@ MaybeObject* Object::GetProperty(Name* key) { } -MaybeObject* Object::GetProperty(Name* key, PropertyAttributes* attributes) { - return GetPropertyWithReceiver(this, key, attributes); -} - - #define FIELD_ADDR(p, offset) \ (reinterpret_cast(p) + offset - kHeapObjectTag) diff --git a/src/objects.cc b/src/objects.cc index 3485f5fe14..73046ddb09 100644 --- a/src/objects.cc +++ b/src/objects.cc @@ -5046,13 +5046,15 @@ Object* JSObject::GetHiddenPropertiesHashTable() { return GetHeap()->undefined_value(); } } else { - PropertyAttributes attributes; - // You can't install a getter on a property indexed by the hidden string, - // so we can be sure that GetLocalPropertyPostInterceptor returns a real - // object. - return GetLocalPropertyPostInterceptor(this, - GetHeap()->hidden_string(), - &attributes)->ToObjectUnchecked(); + LookupResult result(GetIsolate()); + LocalLookupRealNamedProperty(GetHeap()->hidden_string(), &result); + if (result.IsFound()) { + ASSERT(result.IsNormal()); + ASSERT(result.holder() == this); + Object* value = GetNormalizedProperty(&result); + if (!value->IsTheHole()) return value; + } + return GetHeap()->undefined_value(); } } @@ -5854,9 +5856,8 @@ Handle JSObjectWalkVisitor::StructureWalk( // In particular, don't try to copy the length attribute of // an array. if (attributes != NONE) continue; - Handle value( - copy->GetProperty(*key_string, &attributes)->ToObjectUnchecked(), - isolate); + Handle value = Object::GetProperty(copy, key_string); + CHECK_NOT_EMPTY_HANDLE(isolate, value); if (value->IsJSObject()) { Handle result = VisitElementOrProperty( copy, Handle::cast(value)); @@ -13314,20 +13315,6 @@ MaybeHandle JSObject::GetPropertyPostInterceptor( } -MaybeObject* JSObject::GetLocalPropertyPostInterceptor( - Object* receiver, - Name* name, - PropertyAttributes* attributes) { - // Check local property in holder, ignore interceptor. - LookupResult result(GetIsolate()); - LocalLookupRealNamedProperty(name, &result); - if (result.IsFound()) { - return GetProperty(receiver, &result, name, attributes); - } - return GetHeap()->undefined_value(); -} - - MaybeHandle JSObject::GetPropertyWithInterceptor( Handle object, Handle receiver, diff --git a/src/objects.h b/src/objects.h index 97e1621b7a..e7e8e02023 100644 --- a/src/objects.h +++ b/src/objects.h @@ -1535,9 +1535,6 @@ class Object : public MaybeObject { // Property access. MUST_USE_RESULT inline MaybeObject* GetProperty(Name* key); - MUST_USE_RESULT inline MaybeObject* GetProperty( - Name* key, - PropertyAttributes* attributes); // TODO(yangguo): this should eventually replace the non-handlified version. MUST_USE_RESULT static MaybeHandle GetPropertyWithReceiver( @@ -2392,10 +2389,6 @@ class JSObject: public JSReceiver { Handle receiver, Handle name, PropertyAttributes* attributes); - MUST_USE_RESULT MaybeObject* GetLocalPropertyPostInterceptor( - Object* receiver, - Name* name, - PropertyAttributes* attributes); // Returns true if this is an instance of an api function and has // been modified since it was created. May give false positives.