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

Unified Diff: src/map-updater.cc

Issue 2624903003: [runtime] Use PropertyKind/PropertyLocation instead of PropertyType. (Closed)
Patch Set: Addressing comments 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
« no previous file with comments | « src/lookup.cc ('k') | src/objects.h » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: src/map-updater.cc
diff --git a/src/map-updater.cc b/src/map-updater.cc
index 566aedeae889d7dafada4642ce332db8738a8c57..94c5db53b3b80c47dc7a1450cb03bf76dcabd2fd 100644
--- a/src/map-updater.cc
+++ b/src/map-updater.cc
@@ -22,6 +22,10 @@ inline bool EqualImmutableValues(Object* obj1, Object* obj2) {
return false;
}
+inline bool LocationFitsInto(PropertyLocation what, PropertyLocation where) {
+ return where == kField || what == kDescriptor;
+}
+
} // namespace
Name* MapUpdater::GetKey(int descriptor) const {
@@ -276,8 +280,7 @@ MapUpdater::State MapUpdater::FindTargetMap() {
return CopyGeneralizeAllRepresentations("GenAll_Incompatible");
}
// Check if old location fits into tmp location.
- if (old_details.location() == kField &&
- tmp_details.location() == kDescriptor) {
+ if (!LocationFitsInto(old_details.location(), tmp_details.location())) {
break;
}
@@ -573,14 +576,14 @@ MapUpdater::State MapUpdater::ConstructNewMap() {
MaybeHandle<FieldType> new_field_type;
MaybeHandle<Object> old_value;
MaybeHandle<Object> new_value;
- if (old_details.type() == DATA) {
+ if (old_details.location() == kField) {
old_field_type = handle(
old_descriptors_->GetFieldType(modified_descriptor_), isolate_);
} else {
old_value =
handle(old_descriptors_->GetValue(modified_descriptor_), isolate_);
}
- if (new_details.type() == DATA) {
+ if (new_details.location() == kField) {
new_field_type =
handle(new_descriptors->GetFieldType(modified_descriptor_), isolate_);
} else {
« no previous file with comments | « src/lookup.cc ('k') | src/objects.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698