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

Unified Diff: src/property-details.h

Issue 15941016: Move field index into property details, freeing up the value slot of fields. (Closed) Base URL: https://v8.googlecode.com/svn/branches/bleeding_edge
Patch Set: Addressed comments Created 7 years, 7 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') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: src/property-details.h
diff --git a/src/property-details.h b/src/property-details.h
index 3bb1f3368e9efdda6cdef3a6b95e9b003a5e4254..6d0f1479d1e0da38cd59a9263458e97217749a24 100644
--- a/src/property-details.h
+++ b/src/property-details.h
@@ -169,10 +169,12 @@ class PropertyDetails BASE_EMBEDDED {
PropertyDetails(PropertyAttributes attributes,
PropertyType type,
- Representation representation) {
+ Representation representation,
+ int field_index = 0) {
value_ = TypeField::encode(type)
| AttributesField::encode(attributes)
- | RepresentationField::encode(EncodeRepresentation(representation));
+ | RepresentationField::encode(EncodeRepresentation(representation))
+ | FieldIndexField::encode(field_index);
}
int pointer() { return DescriptorPointer::decode(value_); }
@@ -214,6 +216,10 @@ class PropertyDetails BASE_EMBEDDED {
return DecodeRepresentation(RepresentationField::decode(value_));
}
+ int field_index() {
+ return FieldIndexField::decode(value_);
+ }
+
inline PropertyDetails AsDeleted();
static bool IsValidIndex(int index) {
@@ -229,10 +235,15 @@ class PropertyDetails BASE_EMBEDDED {
// constants can be embedded in generated code.
class TypeField: public BitField<PropertyType, 0, 3> {};
class AttributesField: public BitField<PropertyAttributes, 3, 3> {};
+
+ // Bit fields for normalized objects.
class DeletedField: public BitField<uint32_t, 6, 1> {};
class DictionaryStorageField: public BitField<uint32_t, 7, 24> {};
- class DescriptorPointer: public BitField<uint32_t, 7, 11> {};
- class RepresentationField: public BitField<uint32_t, 18, 3> {};
+
+ // Bit fields for fast objects.
+ class DescriptorPointer: public BitField<uint32_t, 6, 11> {};
+ class RepresentationField: public BitField<uint32_t, 17, 3> {};
+ class FieldIndexField: public BitField<uint32_t, 20, 11> {};
static const int kInitialIndex = 1;
« no previous file with comments | « src/property.h ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698