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

Unified Diff: src/lookup.cc

Issue 1165603002: Starting using GlobalDictionary for global objects instead of NameDictionary. (Closed) Base URL: https://chromium.googlesource.com/v8/v8.git@master
Patch Set: Created 5 years, 7 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/heap-snapshot-generator.cc ('k') | src/lookup-inl.h » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: src/lookup.cc
diff --git a/src/lookup.cc b/src/lookup.cc
index 79407d93ee6b4a398c0d6c25c3084f27580a5d31..889988b3ba84b78a23185209e194d7dc1300253d 100644
--- a/src/lookup.cc
+++ b/src/lookup.cc
@@ -258,12 +258,12 @@ bool LookupIterator::HolderIsReceiverOrHiddenPrototype() const {
Handle<Object> LookupIterator::FetchValue() const {
Object* result = NULL;
Handle<JSObject> holder = GetHolder<JSObject>();
- if (holder_map_->is_dictionary_map()) {
+ if (holder_map_->IsGlobalObjectMap()) {
+ result = holder->global_dictionary()->ValueAt(number_);
+ DCHECK(result->IsPropertyCell());
+ result = PropertyCell::cast(result)->value();
+ } else if (holder_map_->is_dictionary_map()) {
result = holder->property_dictionary()->ValueAt(number_);
- if (holder_map_->IsGlobalObjectMap()) {
- DCHECK(result->IsPropertyCell());
- result = PropertyCell::cast(result)->value();
- }
} else if (property_details_.type() == v8::internal::DATA) {
FieldIndex field_index = FieldIndex::ForDescriptor(*holder_map_, number_);
return JSObject::FastPropertyAt(holder, property_details_.representation(),
@@ -315,7 +315,7 @@ Handle<HeapType> LookupIterator::GetFieldType() const {
Handle<PropertyCell> LookupIterator::GetPropertyCell() const {
Handle<JSObject> holder = GetHolder<JSObject>();
Handle<GlobalObject> global = Handle<GlobalObject>::cast(holder);
- Object* value = global->property_dictionary()->ValueAt(dictionary_entry());
+ Object* value = global->global_dictionary()->ValueAt(dictionary_entry());
DCHECK(value->IsPropertyCell());
return handle(PropertyCell::cast(value));
}
@@ -337,15 +337,15 @@ Handle<Object> LookupIterator::GetDataValue() const {
void LookupIterator::WriteDataValue(Handle<Object> value) {
DCHECK_EQ(DATA, state_);
Handle<JSObject> holder = GetHolder<JSObject>();
- if (holder_map_->is_dictionary_map()) {
+ if (holder->IsGlobalObject()) {
+ Handle<GlobalDictionary> property_dictionary =
+ handle(holder->global_dictionary());
+ PropertyCell::UpdateCell(property_dictionary, dictionary_entry(), value,
+ property_details_);
+ } else if (holder_map_->is_dictionary_map()) {
Handle<NameDictionary> property_dictionary =
handle(holder->property_dictionary());
- if (holder->IsGlobalObject()) {
- PropertyCell::UpdateCell(property_dictionary, dictionary_entry(), value,
- property_details_);
- } else {
- property_dictionary->ValueAtPut(dictionary_entry(), *value);
- }
+ property_dictionary->ValueAtPut(dictionary_entry(), *value);
} else if (property_details_.type() == v8::internal::DATA) {
holder->WriteToField(descriptor_number(), *value);
} else {
« no previous file with comments | « src/heap-snapshot-generator.cc ('k') | src/lookup-inl.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698