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

Unified Diff: src/lookup.cc

Issue 2624903003: [runtime] Use PropertyKind/PropertyLocation instead of PropertyType. (Closed)
Patch Set: Created 3 years, 11 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
Index: src/lookup.cc
diff --git a/src/lookup.cc b/src/lookup.cc
index 593e6928f9ae79f9e67c96953e10141f38e9a2c9..8ff36dea26b4668d093f23d87e7c925a79aca938 100644
--- a/src/lookup.cc
+++ b/src/lookup.cc
@@ -593,7 +593,7 @@ Handle<Object> LookupIterator::FetchValue() const {
result = PropertyCell::cast(result)->value();
} else if (!holder_->HasFastProperties()) {
result = holder_->property_dictionary()->ValueAt(number_);
- } else if (property_details_.type() == v8::internal::DATA) {
+ } else if (property_details_.location() == kField) {
Jakob Kummerow 2017/01/12 15:40:30 DCHECK_EQ(kData, details.kind());
Igor Sheludko 2017/01/12 15:52:31 Done.
Handle<JSObject> holder = GetHolder<JSObject>();
FieldIndex field_index = FieldIndex::ForDescriptor(holder->map(), number_);
return JSObject::FastPropertyAt(holder, property_details_.representation(),
@@ -607,14 +607,16 @@ Handle<Object> LookupIterator::FetchValue() const {
int LookupIterator::GetFieldDescriptorIndex() const {
DCHECK(has_property_);
DCHECK(holder_->HasFastProperties());
- DCHECK_EQ(v8::internal::DATA, property_details_.type());
+ DCHECK_EQ(kField, property_details_.location());
+ DCHECK_EQ(kData, property_details_.kind());
return descriptor_number();
}
int LookupIterator::GetAccessorIndex() const {
DCHECK(has_property_);
DCHECK(holder_->HasFastProperties());
- DCHECK_EQ(v8::internal::ACCESSOR_CONSTANT, property_details_.type());
+ DCHECK_EQ(kDescriptor, property_details_.location());
+ DCHECK_EQ(kAccessor, property_details_.kind());
return descriptor_number();
}
@@ -622,7 +624,8 @@ int LookupIterator::GetAccessorIndex() const {
int LookupIterator::GetConstantIndex() const {
DCHECK(has_property_);
DCHECK(holder_->HasFastProperties());
- DCHECK_EQ(v8::internal::DATA_CONSTANT, property_details_.type());
+ DCHECK_EQ(kDescriptor, property_details_.location());
+ DCHECK_EQ(kData, property_details_.kind());
DCHECK(!IsElement());
return descriptor_number();
}
@@ -631,7 +634,7 @@ int LookupIterator::GetConstantIndex() const {
FieldIndex LookupIterator::GetFieldIndex() const {
DCHECK(has_property_);
DCHECK(holder_->HasFastProperties());
- DCHECK_EQ(v8::internal::DATA, property_details_.type());
+ DCHECK_EQ(kField, property_details_.location());
DCHECK(!IsElement());
Map* holder_map = holder_->map();
int index =
@@ -643,7 +646,7 @@ FieldIndex LookupIterator::GetFieldIndex() const {
Handle<FieldType> LookupIterator::GetFieldType() const {
DCHECK(has_property_);
DCHECK(holder_->HasFastProperties());
- DCHECK_EQ(v8::internal::DATA, property_details_.type());
+ DCHECK_EQ(kField, property_details_.location());
return handle(
holder_->map()->instance_descriptors()->GetFieldType(descriptor_number()),
isolate_);
@@ -680,11 +683,11 @@ void LookupIterator::WriteDataValue(Handle<Object> value) {
ElementsAccessor* accessor = object->GetElementsAccessor();
accessor->Set(object, number_, *value);
} else if (holder->HasFastProperties()) {
- if (property_details_.type() == v8::internal::DATA) {
+ if (property_details_.location() == kField) {
JSObject::cast(*holder)->WriteToField(descriptor_number(),
property_details_, *value);
} else {
- DCHECK_EQ(v8::internal::DATA_CONSTANT, property_details_.type());
+ DCHECK_EQ(kDescriptor, property_details_.location());
}
} else if (holder->IsJSGlobalObject()) {
GlobalDictionary* dictionary = JSObject::cast(*holder)->global_dictionary();
« src/json-stringifier.cc ('K') | « src/layout-descriptor-inl.h ('k') | src/map-updater.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698