Index: src/objects.cc |
diff --git a/src/objects.cc b/src/objects.cc |
index 99b5944c811d1d77199f44d5ffe7b069b9962b10..2e5930f6d412a863aaa5f5aed3acb6706e653f76 100644 |
--- a/src/objects.cc |
+++ b/src/objects.cc |
@@ -695,6 +695,20 @@ Object* JSObject::GetNormalizedProperty(const LookupResult* result) { |
} |
+Handle<Object> JSObject::GetNormalizedProperty(Handle<JSObject> object, |
+ const LookupResult* result) { |
+ ASSERT(!object->HasFastProperties()); |
+ Isolate* isolate = object->GetIsolate(); |
+ Handle<Object> value(object->property_dictionary()->ValueAt( |
+ result->GetDictionaryEntry()), isolate); |
+ if (object->IsGlobalObject()) { |
+ value = Handle<Object>(Handle<PropertyCell>::cast(value)->value(), isolate); |
+ } |
+ ASSERT(!value->IsPropertyCell() && !value->IsCell()); |
+ return value; |
+} |
+ |
+ |
void JSObject::SetNormalizedProperty(Handle<JSObject> object, |
const LookupResult* result, |
Handle<Object> value) { |
@@ -5933,6 +5947,41 @@ Handle<JSObject> JSObject::DeepCopy(Handle<JSObject> object, |
} |
+Handle<Object> JSObject::GetDataProperty(Handle<JSObject> object, |
+ Handle<Name> key) { |
+ Isolate* isolate = object->GetIsolate(); |
+ LookupResult lookup(isolate); |
+ { |
+ DisallowHeapAllocation no_allocation; |
+ object->LookupRealNamedProperty(*key, &lookup); |
+ } |
+ Handle<Object> result = isolate->factory()->undefined_value(); |
+ if (lookup.IsFound() && !lookup.IsTransition()) { |
+ switch (lookup.type()) { |
+ case NORMAL: |
+ result = GetNormalizedProperty( |
+ Handle<JSObject>(lookup.holder(), isolate), &lookup); |
+ break; |
+ case FIELD: |
+ result = FastPropertyAt(Handle<JSObject>(lookup.holder(), isolate), |
+ lookup.representation(), |
+ lookup.GetFieldIndex().field_index()); |
+ break; |
+ case CONSTANT: |
+ result = Handle<Object>(lookup.GetConstant(), isolate); |
+ break; |
+ case CALLBACKS: |
+ case HANDLER: |
+ case INTERCEPTOR: |
+ break; |
+ case NONEXISTENT: |
+ UNREACHABLE(); |
+ } |
+ } |
+ return result; |
+} |
+ |
+ |
// Tests for the fast common case for property enumeration: |
// - This object and all prototypes has an enum cache (which means that |
// it is no proxy, has no interceptors and needs no access checks). |