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

Unified Diff: src/lookup-inl.h

Issue 540903002: Flatten property_kind into state. Add UNKNOWN as a state for dict-mode receivers (Closed) Base URL: https://v8.googlecode.com/svn/branches/bleeding_edge
Patch Set: Add DCHECKs Created 6 years, 3 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/lookup.cc ('k') | src/objects.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: src/lookup-inl.h
diff --git a/src/lookup-inl.h b/src/lookup-inl.h
index 022bf7d07b1619aa8dfefb5af0501bb7d14509ed..bb82f1e28315e4722df8d06c66e182e977548532 100644
--- a/src/lookup-inl.h
+++ b/src/lookup-inl.h
@@ -31,7 +31,8 @@ JSReceiver* LookupIterator::NextHolder(Map* map) {
}
-LookupIterator::State LookupIterator::LookupInHolder(Map* map) {
+LookupIterator::State LookupIterator::LookupInHolder(Map* map,
+ JSReceiver* holder) {
STATIC_ASSERT(INTERCEPTOR == BEFORE_PROPERTY);
DisallowHeapAllocation no_gc;
switch (state_) {
@@ -47,14 +48,35 @@ LookupIterator::State LookupIterator::LookupInHolder(Map* map) {
case INTERCEPTOR:
if (map->is_dictionary_map()) {
property_encoding_ = DICTIONARY;
+ if (holder == NULL) return UNKNOWN;
+ NameDictionary* dict = JSObject::cast(holder)->property_dictionary();
+ number_ = dict->FindEntry(name_);
+ if (number_ == NameDictionary::kNotFound) return NOT_FOUND;
+ property_details_ = dict->DetailsAt(number_);
+ if (holder->IsGlobalObject()) {
+ if (property_details_.IsDeleted()) return NOT_FOUND;
+ PropertyCell* cell = PropertyCell::cast(dict->ValueAt(number_));
+ if (cell->value()->IsTheHole()) return NOT_FOUND;
+ }
} else {
DescriptorArray* descriptors = map->instance_descriptors();
number_ = descriptors->SearchWithCache(*name_, map);
if (number_ == DescriptorArray::kNotFound) return NOT_FOUND;
property_encoding_ = DESCRIPTOR;
+ property_details_ = descriptors->GetDetails(number_);
}
- return PROPERTY;
- case PROPERTY:
+ has_property_ = true;
+ switch (property_details_.type()) {
+ case v8::internal::CONSTANT:
+ case v8::internal::FIELD:
+ case v8::internal::NORMAL:
+ return DATA;
+ case v8::internal::CALLBACKS:
+ return ACCESSOR;
+ }
+ case ACCESSOR:
+ case DATA:
+ case UNKNOWN:
return NOT_FOUND;
case JSPROXY:
case TRANSITION:
« no previous file with comments | « src/lookup.cc ('k') | src/objects.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698