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

Unified Diff: src/property-details.h

Issue 14622005: Free up 11 bits in fast-mode PropertyDetails by removing the enumeration-index. (Closed) Base URL: https://v8.googlecode.com/svn/branches/bleeding_edge
Patch Set: 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.cc ('k') | src/runtime.cc » ('j') | 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 f025f152b7f02c46d641ba53f1b9f6a59d8336b0..36c449667a3f4dc2f8a821fc5365ebd32a845c17 100644
--- a/src/property-details.h
+++ b/src/property-details.h
@@ -149,20 +149,21 @@ class PropertyDetails BASE_EMBEDDED {
public:
PropertyDetails(PropertyAttributes attributes,
PropertyType type,
- Representation representation,
- int index = 0) {
+ int index) {
value_ = TypeField::encode(type)
| AttributesField::encode(attributes)
- | RepresentationField::encode(EncodeRepresentation(representation))
| DictionaryStorageField::encode(index);
ASSERT(type == this->type());
ASSERT(attributes == this->attributes());
- if (representation.IsNone()) {
- ASSERT(index == this->dictionary_index());
- } else {
- ASSERT(index == this->descriptor_index());
- }
+ }
+
+ PropertyDetails(PropertyAttributes attributes,
+ PropertyType type,
+ Representation representation) {
+ value_ = TypeField::encode(type)
+ | AttributesField::encode(attributes)
+ | RepresentationField::encode(EncodeRepresentation(representation));
}
int pointer() { return DescriptorPointer::decode(value_); }
@@ -178,17 +179,10 @@ class PropertyDetails BASE_EMBEDDED {
inline Smi* AsSmi();
static uint8_t EncodeRepresentation(Representation representation) {
- ASSERT(representation.kind() <= Representation::kTagged);
- if (representation.kind() < Representation::kInteger32) {
- return representation.kind();
- } else {
- return representation.kind() - 1;
- }
+ return representation.kind();
}
static Representation DecodeRepresentation(uint32_t bits) {
- ASSERT(bits <= Representation::kTagged);
- if (bits >= Representation::kInteger32) bits += 1;
return Representation::FromKind(static_cast<Representation::Kind>(bits));
}
@@ -202,10 +196,6 @@ class PropertyDetails BASE_EMBEDDED {
return DictionaryStorageField::decode(value_);
}
- int descriptor_index() {
- return DescriptorStorageField::decode(value_);
- }
-
Representation representation() {
return DecodeRepresentation(RepresentationField::decode(value_));
}
@@ -227,9 +217,8 @@ class PropertyDetails BASE_EMBEDDED {
class AttributesField: public BitField<PropertyAttributes, 3, 3> {};
class DeletedField: public BitField<uint32_t, 6, 1> {};
class DictionaryStorageField: public BitField<uint32_t, 7, 24> {};
- class DescriptorStorageField: public BitField<uint32_t, 7, 11> {};
- class DescriptorPointer: public BitField<uint32_t, 18, 11> {};
- class RepresentationField: public BitField<uint32_t, 29, 2> {};
+ class DescriptorPointer: public BitField<uint32_t, 7, 11> {};
+ class RepresentationField: public BitField<uint32_t, 18, 3> {};
static const int kInitialIndex = 1;
« no previous file with comments | « src/property.cc ('k') | src/runtime.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698