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

Unified Diff: src/objects-inl.h

Issue 2367493002: Merged: Squashed multiple commits. (Closed)
Patch Set: Created 4 years, 3 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') | src/type-feedback-vector.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 e1df2b662ddc83e9d4c1a661dec9cbab8f9bf626..58441d385365438e4d59f61f852d9b14dc491fff 100644
--- a/src/objects-inl.h
+++ b/src/objects-inl.h
@@ -851,9 +851,8 @@ bool Object::IsSeededNumberDictionary() const {
return IsDictionary();
}
-
-bool Object::IsUnseededNumberDictionary() const {
- return IsDictionary();
+bool HeapObject::IsUnseededNumberDictionary() const {
+ return map() == GetHeap()->unseeded_number_dictionary_map();
}
bool HeapObject::IsStringTable() const { return IsHashTable(); }
@@ -3065,6 +3064,10 @@ void HashTableBase::SetNumberOfDeletedElements(int nod) {
set(kNumberOfDeletedElementsIndex, Smi::FromInt(nod));
}
+template <typename Key>
+Map* BaseShape<Key>::GetMap(Isolate* isolate) {
+ return isolate->heap()->hash_table_map();
+}
template <typename Derived, typename Shape, typename Key>
int HashTable<Derived, Shape, Key>::FindEntry(Key key) {
@@ -7457,14 +7460,16 @@ void BaseDictionaryShape<Key>::SetEntry(Dictionary* dict, int entry,
Handle<Object> key,
Handle<Object> value,
PropertyDetails details) {
- STATIC_ASSERT(Dictionary::kEntrySize == 3);
+ STATIC_ASSERT(Dictionary::kEntrySize == 2 || Dictionary::kEntrySize == 3);
DCHECK(!key->IsName() || details.dictionary_index() > 0);
int index = dict->EntryToIndex(entry);
DisallowHeapAllocation no_gc;
WriteBarrierMode mode = dict->GetWriteBarrierMode(no_gc);
dict->set(index + Dictionary::kEntryKeyIndex, *key, mode);
dict->set(index + Dictionary::kEntryValueIndex, *value, mode);
- dict->set(index + Dictionary::kEntryDetailsIndex, details.AsSmi());
+ if (Dictionary::kEntrySize == 3) {
+ dict->set(index + Dictionary::kEntryDetailsIndex, details.AsSmi());
+ }
}
@@ -7501,6 +7506,9 @@ uint32_t UnseededNumberDictionaryShape::HashForObject(uint32_t key,
return ComputeIntegerHash(static_cast<uint32_t>(other->Number()), 0);
}
+Map* UnseededNumberDictionaryShape::GetMap(Isolate* isolate) {
+ return *isolate->factory()->unseeded_number_dictionary_map();
+}
uint32_t SeededNumberDictionaryShape::SeededHash(uint32_t key, uint32_t seed) {
return ComputeIntegerHash(key, seed);
« no previous file with comments | « src/objects.cc ('k') | src/type-feedback-vector.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698