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

Unified Diff: src/property-details.h

Issue 72333004: Match max property descriptor length to corresponding bit fields (Closed) Base URL: https://v8.googlecode.com/svn/branches/bleeding_edge
Patch Set: Review feedback Created 7 years, 1 month 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/objects.cc ('k') | src/x64/macro-assembler-x64.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 92e4f81c01cb1e6b5f28eee3e5ce74aadd6d18a3..ffed72d7436b5a8269a6099c5bc9667b7adc0e6d 100644
--- a/src/property-details.h
+++ b/src/property-details.h
@@ -194,6 +194,15 @@ class Representation {
};
+static const int kDescriptorIndexBitCount = 10;
+// The maximum number of descriptors we want in a descriptor array (should
+// fit in a page).
+static const int kMaxNumberOfDescriptors =
+ (1 << kDescriptorIndexBitCount) - 2;
+static const int kInvalidEnumCacheSentinel =
+ (1 << kDescriptorIndexBitCount) - 1;
+
+
// PropertyDetails captures type and attributes for a property.
// They are used both in property dictionaries and instance descriptors.
class PropertyDetails BASE_EMBEDDED {
@@ -284,9 +293,14 @@ class PropertyDetails BASE_EMBEDDED {
class DictionaryStorageField: public BitField<uint32_t, 7, 24> {};
// Bit fields for fast objects.
- class DescriptorPointer: public BitField<uint32_t, 6, 11> {};
- class RepresentationField: public BitField<uint32_t, 17, 4> {};
- class FieldIndexField: public BitField<uint32_t, 21, 10> {};
+ class RepresentationField: public BitField<uint32_t, 6, 4> {};
+ class DescriptorPointer: public BitField<uint32_t, 10,
+ kDescriptorIndexBitCount> {};
+ class FieldIndexField: public BitField<uint32_t,
+ 10 + kDescriptorIndexBitCount,
+ kDescriptorIndexBitCount> {};
+ // All bits for fast objects must fix in a smi.
+ STATIC_ASSERT(10 + kDescriptorIndexBitCount + kDescriptorIndexBitCount <= 31);
static const int kInitialIndex = 1;
« no previous file with comments | « src/objects.cc ('k') | src/x64/macro-assembler-x64.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698