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

Unified Diff: src/objects.h

Issue 2688573003: [cleanup] CSA: add helpers for accessing details/value via key_index (Closed)
Patch Set: rebased 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/ic/keyed-store-generic.cc ('k') | src/objects-inl.h » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: src/objects.h
diff --git a/src/objects.h b/src/objects.h
index d76ffde41fba5bb2f2e27cab24f967696c67cfe2..f72f7b0001ab7a1d792a02948fec29a0441867f7 100644
--- a/src/objects.h
+++ b/src/objects.h
@@ -3133,7 +3133,7 @@ class FrameArray : public FixedArray {
// [0]: pointer to fixed array with enum cache
// [1]: either Smi(0) or pointer to fixed array with indices
// [2]: first key
-// [2 + number of descriptors * kDescriptorSize]: start of slack
+// [2 + number of descriptors * kEntrySize]: start of slack
class DescriptorArray: public FixedArray {
public:
// Returns true for both shared empty_descriptor_array and for smis, which the
@@ -3254,10 +3254,11 @@ class DescriptorArray: public FixedArray {
static const int kEnumCacheBridgeCacheOffset = FixedArray::kHeaderSize;
// Layout of descriptor.
- static const int kDescriptorKey = 0;
- static const int kDescriptorDetails = 1;
- static const int kDescriptorValue = 2;
- static const int kDescriptorSize = 3;
+ // Naming is consistent with Dictionary classes for easy templating.
+ static const int kEntryKeyIndex = 0;
+ static const int kEntryDetailsIndex = 1;
+ static const int kEntryValueIndex = 2;
+ static const int kEntrySize = 3;
#if defined(DEBUG) || defined(OBJECT_PRINT)
// For our gdb macros, we should perhaps change these in the future.
@@ -3288,18 +3289,16 @@ class DescriptorArray: public FixedArray {
}
static int ToDetailsIndex(int descriptor_number) {
- return kFirstIndex + (descriptor_number * kDescriptorSize) +
- kDescriptorDetails;
+ return kFirstIndex + (descriptor_number * kEntrySize) + kEntryDetailsIndex;
}
// Conversion from descriptor number to array indices.
static int ToKeyIndex(int descriptor_number) {
- return kFirstIndex + (descriptor_number * kDescriptorSize) + kDescriptorKey;
+ return kFirstIndex + (descriptor_number * kEntrySize) + kEntryKeyIndex;
}
static int ToValueIndex(int descriptor_number) {
- return kFirstIndex + (descriptor_number * kDescriptorSize) +
- kDescriptorValue;
+ return kFirstIndex + (descriptor_number * kEntrySize) + kEntryValueIndex;
}
private:
« no previous file with comments | « src/ic/keyed-store-generic.cc ('k') | src/objects-inl.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698