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

Unified Diff: src/property.cc

Issue 2598543003: [runtime][ic] Constant field tracking support. (Closed)
Patch Set: Addressing comments Created 3 years, 10 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 1ff1dc63a0796ceb91c70635c416e190f44e23c9..339076dbb4f21de9dbc21f45a4cdea63dd997d4c 100644
--- a/src/property.cc
+++ b/src/property.cc
@@ -40,6 +40,20 @@ Descriptor Descriptor::DataField(Handle<Name> key, int field_index,
return Descriptor(key, wrapped_field_type, details);
}
+Descriptor Descriptor::DataConstant(Handle<Name> key, int field_index,
+ Handle<Object> value,
+ PropertyAttributes attributes) {
+ if (FLAG_track_constant_fields) {
+ Handle<Object> any_type(FieldType::Any(), key->GetIsolate());
+ return DataField(key, field_index, attributes, kConst,
+ Representation::Tagged(), any_type);
+
+ } else {
+ return Descriptor(key, value, kData, attributes, kDescriptor, kConst,
+ value->OptimalRepresentation(), field_index);
+ }
+}
+
// Outputs PropertyDetails as a dictionary details.
void PropertyDetails::PrintAsSlowTo(std::ostream& os) {
os << "(";
« 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