Reviewers: Igor Sheludko,
Description:
Remove uses of non-handlified GetProperty.
[email protected]
Please review this at https://codereview.chromium.org/229373007/
SVN Base: https://v8.googlecode.com/svn/branches/bleeding_edge
Affected files (+11, -36 lines):
M src/objects.h
M src/objects.cc
M src/objects-inl.h
Index: src/objects-inl.h
diff --git a/src/objects-inl.h b/src/objects-inl.h
index
d6665d6f0165c32d2c891e5056e9169effac7496..2b425a6b5242270ed70998d01ee2827f4a57fbd5
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<byte*>(p) + offset - kHeapObjectTag)
Index: src/objects.cc
diff --git a/src/objects.cc b/src/objects.cc
index
3485f5fe1408022631df75120ae1f582f26a6d27..73046ddb091109abb315e7d61cef349f8f519f9f
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<JSObject>
JSObjectWalkVisitor<ContextObject>::StructureWalk(
// In particular, don't try to copy the length attribute of
// an array.
if (attributes != NONE) continue;
- Handle<Object> value(
- copy->GetProperty(*key_string,
&attributes)->ToObjectUnchecked(),
- isolate);
+ Handle<Object> value = Object::GetProperty(copy, key_string);
+ CHECK_NOT_EMPTY_HANDLE(isolate, value);
if (value->IsJSObject()) {
Handle<JSObject> result = VisitElementOrProperty(
copy, Handle<JSObject>::cast(value));
@@ -13314,20 +13315,6 @@ MaybeHandle<Object>
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<Object> JSObject::GetPropertyWithInterceptor(
Handle<JSObject> object,
Handle<Object> receiver,
Index: src/objects.h
diff --git a/src/objects.h b/src/objects.h
index
d4a1f702b96910bf3580f076ce5519b65b512c46..1ef0e5f672692558988c28022bf9517af684cd55
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<Object> GetPropertyWithReceiver(
@@ -2392,10 +2389,6 @@ class JSObject: public JSReceiver {
Handle<Object> receiver,
Handle<Name> 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.
--
--
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.