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

Unified Diff: src/objects.cc

Issue 480823004: Get rid of GetLazyValue and clients. (Closed) Base URL: https://v8.googlecode.com/svn/branches/bleeding_edge
Patch Set: Created 6 years, 4 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') | no next file with comments »
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 e8c38385ea29e2330345bf8cabc115f6518432f0..e4961632051cd0a7a70b10272a4dd429a3500126 100644
--- a/src/objects.cc
+++ b/src/objects.cc
@@ -143,28 +143,35 @@ MaybeHandle<Object> Object::GetProperty(LookupIterator* it) {
Handle<Object> JSObject::GetDataProperty(Handle<JSObject> object,
Handle<Name> key) {
LookupIterator it(object, key, LookupIterator::CHECK_DERIVED_PROPERTY);
- for (; it.IsFound(); it.Next()) {
- switch (it.state()) {
+ return GetDataProperty(&it);
+}
+
+
+Handle<Object> JSObject::GetDataProperty(LookupIterator* it) {
+ for (; it->IsFound(); it->Next()) {
+ switch (it->state()) {
case LookupIterator::NOT_FOUND:
case LookupIterator::ACCESS_CHECK:
case LookupIterator::INTERCEPTOR:
UNREACHABLE();
case LookupIterator::JSPROXY:
- return it.isolate()->factory()->undefined_value();
+ it->NotFound();
+ return it->isolate()->factory()->undefined_value();
case LookupIterator::PROPERTY:
- if (!it.HasProperty()) continue;
- switch (it.property_kind()) {
+ if (!it->HasProperty()) continue;
+ switch (it->property_kind()) {
case LookupIterator::DATA:
- return it.GetDataValue();
+ return it->GetDataValue();
case LookupIterator::ACCESSOR:
// TODO(verwaest): For now this doesn't call into
// ExecutableAccessorInfo, since clients don't need it. Update once
// relevant.
- return it.isolate()->factory()->undefined_value();
+ it->NotFound();
+ return it->isolate()->factory()->undefined_value();
}
}
}
- return it.isolate()->factory()->undefined_value();
+ return it->isolate()->factory()->undefined_value();
}
@@ -647,17 +654,6 @@ MaybeHandle<Object> JSObject::SetPropertyWithFailedAccessCheck(
}
-Object* JSObject::GetNormalizedProperty(const LookupResult* result) {
- DCHECK(!HasFastProperties());
- Object* value = property_dictionary()->ValueAt(result->GetDictionaryEntry());
- if (IsGlobalObject()) {
- value = PropertyCell::cast(value)->value();
- }
- DCHECK(!value->IsPropertyCell() && !value->IsCell());
- return value;
-}
-
-
void JSObject::SetNormalizedProperty(Handle<JSObject> object,
Handle<Name> name,
Handle<Object> value,
@@ -4766,12 +4762,11 @@ Object* JSObject::GetHiddenPropertiesHashTable() {
}
} else {
Isolate* isolate = GetIsolate();
- LookupResult result(isolate);
- LookupOwnRealNamedProperty(isolate->factory()->hidden_string(), &result);
- if (result.IsFound()) {
- DCHECK(result.IsNormal());
- DCHECK(result.holder() == this);
- return GetNormalizedProperty(&result);
+ LookupIterator it(handle(this), isolate->factory()->hidden_string(),
+ LookupIterator::CHECK_PROPERTY);
+ if (it.IsFound() && it.HasProperty()) {
+ DCHECK_EQ(LookupIterator::DATA, it.property_kind());
+ return *it.GetDataValue();
}
return GetHeap()->undefined_value();
}
« no previous file with comments | « src/objects.h ('k') | src/property.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698