Index: src/property-details.h |
diff --git a/src/property-details.h b/src/property-details.h |
index 64501c0550a3d232213e5a5f14cbb2486b2dcada..6e9184d39ecc4df6ec0c594a75d809c5569901f6 100644 |
--- a/src/property-details.h |
+++ b/src/property-details.h |
@@ -7,6 +7,8 @@ |
#include "include/v8.h" |
#include "src/allocation.h" |
+// TODO(ishell): remove once FLAG_track_constant_fields is removed. |
+#include "src/flags.h" |
#include "src/utils.h" |
namespace v8 { |
@@ -76,6 +78,10 @@ enum PropertyLocation { kField = 0, kDescriptor = 1 }; |
// Must fit in the BitField PropertyDetails::ConstnessField. |
enum PropertyConstness { kMutable = 0, kConst = 1 }; |
+// TODO(ishell): remove once constant field tracking is done. |
+const PropertyConstness kDefaultFieldConstness = |
+ FLAG_track_constant_fields ? kConst : kMutable; |
+ |
class Representation { |
public: |
enum Kind { |
@@ -270,6 +276,9 @@ class PropertyDetails BASE_EMBEDDED { |
PropertyDetails CopyWithRepresentation(Representation representation) const { |
return PropertyDetails(value_, representation); |
} |
+ PropertyDetails CopyWithConstness(PropertyConstness constness) const { |
+ return PropertyDetails(value_, constness); |
+ } |
PropertyDetails CopyAddAttributes(PropertyAttributes new_attributes) const { |
new_attributes = |
static_cast<PropertyAttributes>(attributes() | new_attributes); |
@@ -380,6 +389,9 @@ class PropertyDetails BASE_EMBEDDED { |
value_ = RepresentationField::update( |
value, EncodeRepresentation(representation)); |
} |
+ PropertyDetails(int value, PropertyConstness constness) { |
+ value_ = ConstnessField::update(value, constness); |
+ } |
PropertyDetails(int value, PropertyAttributes attributes) { |
value_ = AttributesField::update(value, attributes); |
} |