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

Unified Diff: src/objects-inl.h

Issue 151155: Revert 2324 until we can fix build and test errors. (Closed) Base URL: http://v8.googlecode.com/svn/branches/bleeding_edge/
Patch Set: Created 11 years, 6 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
===================================================================
--- src/objects-inl.h (revision 2324)
+++ src/objects-inl.h (working copy)
@@ -1370,14 +1370,15 @@
}
-bool NumberDictionary::requires_slow_elements() {
+bool Dictionary::requires_slow_elements() {
Object* max_index_object = get(kMaxNumberKeyIndex);
if (!max_index_object->IsSmi()) return false;
return 0 !=
(Smi::cast(max_index_object)->value() & kRequiresSlowElementsMask);
}
-uint32_t NumberDictionary::max_number_key() {
+
+uint32_t Dictionary::max_number_key() {
ASSERT(!requires_slow_elements());
Object* max_index_object = get(kMaxNumberKeyIndex);
if (!max_index_object->IsSmi()) return 0;
@@ -1385,7 +1386,8 @@
return value >> kRequiresSlowElementsTagSize;
}
-void NumberDictionary::set_requires_slow_elements() {
+
+void Dictionary::set_requires_slow_elements() {
set(kMaxNumberKeyIndex,
Smi::FromInt(kRequiresSlowElementsMask),
SKIP_WRITE_BARRIER);
@@ -1398,6 +1400,7 @@
CAST_ACCESSOR(FixedArray)
CAST_ACCESSOR(DescriptorArray)
+CAST_ACCESSOR(Dictionary)
CAST_ACCESSOR(SymbolTable)
CAST_ACCESSOR(CompilationCacheTable)
CAST_ACCESSOR(MapCache)
@@ -1436,9 +1439,9 @@
STRUCT_LIST(MAKE_STRUCT_CAST)
#undef MAKE_STRUCT_CAST
-
-template <typename Shape, typename Key>
-HashTable<Shape, Key>* HashTable<Shape, Key>::cast(Object* obj) {
+template <int prefix_size, int elem_size>
+HashTable<prefix_size, elem_size>* HashTable<prefix_size, elem_size>::cast(
+ Object* obj) {
ASSERT(obj->IsHashTable());
return reinterpret_cast<HashTable*>(obj);
}
@@ -2465,15 +2468,15 @@
}
-StringDictionary* JSObject::property_dictionary() {
+Dictionary* JSObject::property_dictionary() {
ASSERT(!HasFastProperties());
- return StringDictionary::cast(properties());
+ return Dictionary::cast(properties());
}
-NumberDictionary* JSObject::element_dictionary() {
+Dictionary* JSObject::element_dictionary() {
ASSERT(!HasFastElements());
- return NumberDictionary::cast(elements());
+ return Dictionary::cast(elements());
}
@@ -2637,17 +2640,16 @@
set_flag(Smi::FromInt(rest_value | AttributesField::encode(attributes)));
}
-template<typename Shape, typename Key>
-void Dictionary<Shape, Key>::SetEntry(int entry,
- Object* key,
- Object* value,
- PropertyDetails details) {
+void Dictionary::SetEntry(int entry,
+ Object* key,
+ Object* value,
+ PropertyDetails details) {
ASSERT(!key->IsString() || details.index() > 0);
- int index = HashTable<Shape, Key>::EntryToIndex(entry);
- WriteBarrierMode mode = FixedArray::GetWriteBarrierMode();
- FixedArray::set(index, key, mode);
- FixedArray::set(index+1, value, mode);
- FixedArray::fast_set(this, index+2, details.AsSmi());
+ int index = EntryToIndex(entry);
+ WriteBarrierMode mode = GetWriteBarrierMode();
+ set(index, key, mode);
+ set(index+1, value, mode);
+ fast_set(this, index+2, details.AsSmi());
}
« 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