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

Unified Diff: src/property.cc

Issue 2591233002: [runtime] Add PropertyConstness bit to PropertyDetails. (Closed)
Patch Set: Addressed comments, used better name: IsGeneralizableTo 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/property.h ('k') | src/property-details.h » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: src/property.cc
diff --git a/src/property.cc b/src/property.cc
index 1c2666b00ac436893c81db3da6280fd8b8b8b6be..1ff1dc63a0796ceb91c70635c416e190f44e23c9 100644
--- a/src/property.cc
+++ b/src/property.cc
@@ -25,13 +25,25 @@ std::ostream& operator<<(std::ostream& os,
Descriptor Descriptor::DataField(Handle<Name> key, int field_index,
PropertyAttributes attributes,
Representation representation) {
- return DataField(key, field_index, FieldType::Any(key->GetIsolate()),
- attributes, representation);
+ return DataField(key, field_index, attributes, kMutable, representation,
+ FieldType::Any(key->GetIsolate()));
+}
+
+Descriptor Descriptor::DataField(Handle<Name> key, int field_index,
+ PropertyAttributes attributes,
+ PropertyConstness constness,
+ Representation representation,
+ Handle<Object> wrapped_field_type) {
+ DCHECK(wrapped_field_type->IsSmi() || wrapped_field_type->IsWeakCell());
+ PropertyDetails details(kData, attributes, kField, constness, representation,
+ field_index);
+ return Descriptor(key, wrapped_field_type, details);
}
// Outputs PropertyDetails as a dictionary details.
void PropertyDetails::PrintAsSlowTo(std::ostream& os) {
os << "(";
+ if (constness() == kConst) os << "const ";
os << (kind() == kData ? "data" : "accessor");
os << ", dictionary_index: " << dictionary_index();
os << ", attrs: " << attributes() << ")";
@@ -40,6 +52,7 @@ void PropertyDetails::PrintAsSlowTo(std::ostream& os) {
// Outputs PropertyDetails as a descriptor array details.
void PropertyDetails::PrintAsFastTo(std::ostream& os, PrintMode mode) {
os << "(";
+ if (constness() == kConst) os << "const ";
os << (kind() == kData ? "data" : "accessor");
if (location() == kField) {
os << " field";
« no previous file with comments | « src/property.h ('k') | src/property-details.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698