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

Unified Diff: src/objects-inl.h

Issue 237043002: Revert "Reland "HashTable::Shrink() handlified and derived template parameter added to HashTable hi… (Closed) Base URL: https://v8.googlecode.com/svn/branches/bleeding_edge
Patch Set: Created 6 years, 8 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/objects.cc ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: src/objects-inl.h
diff --git a/src/objects-inl.h b/src/objects-inl.h
index 221c1da96965590156be4626fe4c135db640ab46..cde38189d0a9ff3f958ec1bb71d1bc0a7a7b4723 100644
--- a/src/objects-inl.h
+++ b/src/objects-inl.h
@@ -2882,8 +2882,8 @@ DescriptorArray::WhitenessWitness::~WhitenessWitness() {
}
-template<typename Derived, typename Shape, typename Key>
-int HashTable<Derived, Shape, Key>::ComputeCapacity(int at_least_space_for) {
+template<typename Shape, typename Key>
+int HashTable<Shape, Key>::ComputeCapacity(int at_least_space_for) {
const int kMinCapacity = 32;
int capacity = RoundUpToPowerOf2(at_least_space_for * 2);
if (capacity < kMinCapacity) {
@@ -2893,17 +2893,17 @@ int HashTable<Derived, Shape, Key>::ComputeCapacity(int at_least_space_for) {
}
-template<typename Derived, typename Shape, typename Key>
-int HashTable<Derived, Shape, Key>::FindEntry(Key key) {
+template<typename Shape, typename Key>
+int HashTable<Shape, Key>::FindEntry(Key key) {
return FindEntry(GetIsolate(), key);
}
// Find entry for key otherwise return kNotFound.
-template<typename Derived, typename Shape, typename Key>
-int HashTable<Derived, Shape, Key>::FindEntry(Isolate* isolate, Key key) {
+template<typename Shape, typename Key>
+int HashTable<Shape, Key>::FindEntry(Isolate* isolate, Key key) {
uint32_t capacity = Capacity();
- uint32_t entry = FirstProbe(HashTable::Hash(key), capacity);
+ uint32_t entry = FirstProbe(HashTable<Shape, Key>::Hash(key), capacity);
uint32_t count = 1;
// EnsureCapacity will guarantee the hash table is never full.
while (true) {
@@ -3028,9 +3028,8 @@ FixedTypedArray<Traits>* FixedTypedArray<Traits>::cast(Object* object) {
#undef MAKE_STRUCT_CAST
-template <typename Derived, typename Shape, typename Key>
-HashTable<Derived, Shape, Key>*
-HashTable<Derived, Shape, Key>::cast(Object* obj) {
+template <typename Shape, typename Key>
+HashTable<Shape, Key>* HashTable<Shape, Key>::cast(Object* obj) {
ASSERT(obj->IsHashTable());
return reinterpret_cast<HashTable*>(obj);
}
@@ -6672,23 +6671,23 @@ bool AccessorPair::prohibits_overwriting() {
}
-template<typename Derived, typename Shape, typename Key>
-void Dictionary<Derived, Shape, Key>::SetEntry(int entry,
- Object* key,
- Object* value) {
+template<typename Shape, typename Key>
+void Dictionary<Shape, Key>::SetEntry(int entry,
+ Object* key,
+ Object* value) {
SetEntry(entry, key, value, PropertyDetails(Smi::FromInt(0)));
}
-template<typename Derived, typename Shape, typename Key>
-void Dictionary<Derived, Shape, Key>::SetEntry(int entry,
- Object* key,
- Object* value,
- PropertyDetails details) {
+template<typename Shape, typename Key>
+void Dictionary<Shape, Key>::SetEntry(int entry,
+ Object* key,
+ Object* value,
+ PropertyDetails details) {
ASSERT(!key->IsName() ||
details.IsDeleted() ||
details.dictionary_index() > 0);
- int index = DerivedHashTable::EntryToIndex(entry);
+ int index = HashTable<Shape, Key>::EntryToIndex(entry);
DisallowHeapAllocation no_gc;
WriteBarrierMode mode = FixedArray::GetWriteBarrierMode(no_gc);
FixedArray::set(index, key, mode);
@@ -6774,12 +6773,6 @@ MaybeObject* ObjectHashTableShape::AsObject(Heap* heap, Object* key) {
}
-Handle<ObjectHashTable> ObjectHashTable::Shrink(
- Handle<ObjectHashTable> table, Handle<Object> key) {
- return HashTable_::Shrink(table, *key);
-}
-
-
template <int entrysize>
bool WeakHashTableShape<entrysize>::IsMatch(Object* key, Object* other) {
return key->SameValue(other);
« no previous file with comments | « src/objects.cc ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698