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

Unified Diff: src/bootstrapper.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 | « no previous file | src/compiler/access-info.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: src/bootstrapper.cc
diff --git a/src/bootstrapper.cc b/src/bootstrapper.cc
index 69118b31c42913b7fbd6a4cd34e705abba3c1559..d26a27bf645ebfd9717bfc5b262b9687612319ad 100644
--- a/src/bootstrapper.cc
+++ b/src/bootstrapper.cc
@@ -4360,8 +4360,8 @@ void Genesis::TransferNamedProperties(Handle<JSObject> from,
Handle<DescriptorArray>(from->map()->instance_descriptors());
for (int i = 0; i < from->map()->NumberOfOwnDescriptors(); i++) {
PropertyDetails details = descs->GetDetails(i);
- switch (details.type()) {
- case DATA: {
+ if (details.location() == kField) {
+ if (details.kind() == kData) {
HandleScope inner(isolate());
Handle<Name> key = Handle<Name>(descs->GetKey(i));
FieldIndex index = FieldIndex::ForDescriptor(from->map(), i);
@@ -4369,18 +4369,21 @@ void Genesis::TransferNamedProperties(Handle<JSObject> from,
Handle<Object> value = Handle<Object>(from->RawFastPropertyAt(index),
isolate());
JSObject::AddProperty(to, key, value, details.attributes());
- break;
+ } else {
+ DCHECK_EQ(kAccessor, details.kind());
+ UNREACHABLE();
}
- case DATA_CONSTANT: {
+
+ } else {
+ DCHECK_EQ(kDescriptor, details.location());
+ if (details.kind() == kData) {
HandleScope inner(isolate());
Handle<Name> key = Handle<Name>(descs->GetKey(i));
Handle<Object> constant(descs->GetConstant(i), isolate());
JSObject::AddProperty(to, key, constant, details.attributes());
- break;
- }
- case ACCESSOR:
- UNREACHABLE();
- case ACCESSOR_CONSTANT: {
+
+ } else {
+ DCHECK_EQ(kAccessor, details.kind());
Handle<Name> key(descs->GetKey(i));
LookupIterator it(to, key, LookupIterator::OWN_SKIP_INTERCEPTOR);
CHECK_NE(LookupIterator::ACCESS_CHECK, it.state());
@@ -4393,7 +4396,6 @@ void Genesis::TransferNamedProperties(Handle<JSObject> from,
PropertyDetails d(details.attributes(), ACCESSOR_CONSTANT, i + 1,
PropertyCellType::kMutable);
JSObject::SetNormalizedProperty(to, key, callbacks, d);
- break;
}
}
}
« no previous file with comments | « no previous file | src/compiler/access-info.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698