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

Unified Diff: src/objects-inl.h

Issue 225183009: Use OrderedHashTables as the backing store of JSSet and JSMap (Closed) Base URL: https://v8.googlecode.com/svn/branches/bleeding_edge
Patch Set: Get rid of IsOrderedHashSet/Map methods 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-debug.cc ('k') | src/runtime.cc » ('j') | 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 978704ac54286aff224e370390121e305cd45100..c7ded8db7b63ca33df60068357bba10eb433c1af 100644
--- a/src/objects-inl.h
+++ b/src/objects-inl.h
@@ -920,6 +920,13 @@ bool Object::IsObjectHashTable() {
}
+bool Object::IsOrderedHashTable() {
+ return IsHeapObject() &&
+ HeapObject::cast(this)->map() ==
+ HeapObject::cast(this)->GetHeap()->ordered_hash_table_map();
+}
+
+
bool Object::IsPrimitive() {
return IsOddball() || IsNumber() || IsString();
}
@@ -6588,28 +6595,22 @@ MaybeObject* NameDictionaryShape::AsObject(Heap* heap, Name* key) {
}
-template <int entrysize>
-bool ObjectHashTableShape<entrysize>::IsMatch(Object* key, Object* other) {
+bool ObjectHashTableShape::IsMatch(Object* key, Object* other) {
return key->SameValue(other);
}
-template <int entrysize>
-uint32_t ObjectHashTableShape<entrysize>::Hash(Object* key) {
+uint32_t ObjectHashTableShape::Hash(Object* key) {
return Smi::cast(key->GetHash())->value();
}
-template <int entrysize>
-uint32_t ObjectHashTableShape<entrysize>::HashForObject(Object* key,
- Object* other) {
+uint32_t ObjectHashTableShape::HashForObject(Object* key, Object* other) {
return Smi::cast(other->GetHash())->value();
}
-template <int entrysize>
-MaybeObject* ObjectHashTableShape<entrysize>::AsObject(Heap* heap,
- Object* key) {
+MaybeObject* ObjectHashTableShape::AsObject(Heap* heap, Object* key) {
return key;
}
« no previous file with comments | « src/objects-debug.cc ('k') | src/runtime.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698