Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(878)

Unified Diff: src/objects.cc

Issue 27000006: Handlify GetNormalizedProperty. (Closed) Base URL: https://v8.googlecode.com/svn/branches/bleeding_edge
Patch Set: Created 7 years, 2 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « src/objects.h ('k') | src/property.h » ('j') | src/property.h » ('J')
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: src/objects.cc
diff --git a/src/objects.cc b/src/objects.cc
index f39b760402e1f05a937dbaac7d278aa277ca2855..86004ce25b1119b8c82fd65b4e3e2a0c40b69d98 100644
--- a/src/objects.cc
+++ b/src/objects.cc
@@ -649,11 +649,15 @@ PropertyAttributes JSObject::GetPropertyAttributeWithFailedAccessCheck(
}
-Object* JSObject::GetNormalizedProperty(LookupResult* result) {
- ASSERT(!HasFastProperties());
- Object* value = property_dictionary()->ValueAt(result->GetDictionaryEntry());
- if (IsGlobalObject()) {
- value = PropertyCell::cast(value)->value();
+Handle<Object> JSObject::GetNormalizedProperty(Handle<JSObject> object,
+ 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;
@@ -888,10 +892,13 @@ MaybeObject* Object::GetProperty(Object* receiver,
*attributes = result->GetAttributes();
Object* value;
switch (result->type()) {
- case NORMAL:
- value = result->holder()->GetNormalizedProperty(result);
+ case NORMAL: {
+ HandleScope scope(isolate);
+ Handle<Object> value =
+ JSObject::GetNormalizedProperty(handle(result->holder()), result);
ASSERT(!value->IsTheHole() || result->IsReadOnly());
- return value->IsTheHole() ? heap->undefined_value() : value;
+ return value->IsTheHole() ? heap->undefined_value() : *value;
+ }
case FIELD: {
MaybeObject* maybe_result = result->holder()->FastPropertyAt(
result->representation(),
« no previous file with comments | « src/objects.h ('k') | src/property.h » ('j') | src/property.h » ('J')

Powered by Google App Engine
This is Rietveld 408576698