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

Unified Diff: src/objects.h

Issue 757143002: Optimize non-mutation Map and Set operations for String keys (Closed) Base URL: https://chromium.googlesource.com/v8/v8.git@master
Patch Set: Replace End calls with IfBuilder destructor Created 6 years 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/hydrogen-instructions.h ('k') | src/runtime/runtime.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 911458c3cb68d47532640e8fac6e0d88034350c8..ab8f72545b87a2fcf1723445f3c1cd121091a996 100644
--- a/src/objects.h
+++ b/src/objects.h
@@ -3901,6 +3901,19 @@ class OrderedHashTable: public FixedArray {
static const int kNotFound = -1;
static const int kMinCapacity = 4;
+ static const int kNumberOfBucketsIndex = 0;
+ static const int kNumberOfElementsIndex = kNumberOfBucketsIndex + 1;
+ static const int kNumberOfDeletedElementsIndex = kNumberOfElementsIndex + 1;
+ static const int kHashTableStartIndex = kNumberOfDeletedElementsIndex + 1;
+
+ static const int kNumberOfBucketsOffset =
+ kHeaderSize + kNumberOfBucketsIndex * kPointerSize;
+ static const int kNumberOfElementsOffset =
+ kHeaderSize + kNumberOfElementsIndex * kPointerSize;
+
+ static const int kEntrySize = entrysize + 1;
+ static const int kChainOffset = entrysize;
+
private:
static Handle<Derived> Rehash(Handle<Derived> table, int new_capacity);
@@ -3942,17 +3955,9 @@ class OrderedHashTable: public FixedArray {
return set(kRemovedHolesIndex + index, Smi::FromInt(removed_index));
}
- static const int kNumberOfBucketsIndex = 0;
- static const int kNumberOfElementsIndex = kNumberOfBucketsIndex + 1;
- static const int kNumberOfDeletedElementsIndex = kNumberOfElementsIndex + 1;
- static const int kHashTableStartIndex = kNumberOfDeletedElementsIndex + 1;
-
static const int kNextTableIndex = kNumberOfElementsIndex;
static const int kRemovedHolesIndex = kHashTableStartIndex;
- static const int kEntrySize = entrysize + 1;
- static const int kChainOffset = entrysize;
-
static const int kLoadFactor = 2;
static const int kMaxCapacity =
(FixedArray::kMaxLength - kHashTableStartIndex)
@@ -3992,7 +3997,6 @@ class OrderedHashMap:public OrderedHashTable<
return get(EntryToIndex(entry) + kValueOffset);
}
- private:
static const int kValueOffset = 1;
};
« no previous file with comments | « src/hydrogen-instructions.h ('k') | src/runtime/runtime.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698