Version 1.2.12.
Added stack traces collection to Error objects accessible through the e.stack property.
Changed RegExp parser to use a recursive data structure instead of stack-based recursion.
Optimized Date object construction and string concatenation.
Improved performance of div, mod, and mul on ARM platforms.
git-svn-id: http://v8.googlecode.com/svn/trunk@2361 ce2b1a6d-e550-0410-aec6-3dcde31c8c00
diff --git a/src/objects-inl.h b/src/objects-inl.h
index c360fd7..ff0f2e5 100644
--- a/src/objects-inl.h
+++ b/src/objects-inl.h
@@ -699,7 +699,7 @@
int Smi::value() {
- return static_cast<int>(reinterpret_cast<intptr_t>(this) >> kSmiTagSize);
+ return static_cast<int>(reinterpret_cast<intptr_t>(this)) >> kSmiTagSize;
}
@@ -1370,15 +1370,14 @@
}
-bool Dictionary::requires_slow_elements() {
+bool NumberDictionary::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 Dictionary::max_number_key() {
+uint32_t NumberDictionary::max_number_key() {
ASSERT(!requires_slow_elements());
Object* max_index_object = get(kMaxNumberKeyIndex);
if (!max_index_object->IsSmi()) return 0;
@@ -1386,8 +1385,7 @@
return value >> kRequiresSlowElementsTagSize;
}
-
-void Dictionary::set_requires_slow_elements() {
+void NumberDictionary::set_requires_slow_elements() {
set(kMaxNumberKeyIndex,
Smi::FromInt(kRequiresSlowElementsMask),
SKIP_WRITE_BARRIER);
@@ -1400,7 +1398,6 @@
CAST_ACCESSOR(FixedArray)
CAST_ACCESSOR(DescriptorArray)
-CAST_ACCESSOR(Dictionary)
CAST_ACCESSOR(SymbolTable)
CAST_ACCESSOR(CompilationCacheTable)
CAST_ACCESSOR(MapCache)
@@ -1439,9 +1436,9 @@
STRUCT_LIST(MAKE_STRUCT_CAST)
#undef MAKE_STRUCT_CAST
-template <int prefix_size, int elem_size>
-HashTable<prefix_size, elem_size>* HashTable<prefix_size, elem_size>::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);
}
@@ -2468,15 +2465,15 @@
}
-Dictionary* JSObject::property_dictionary() {
+StringDictionary* JSObject::property_dictionary() {
ASSERT(!HasFastProperties());
- return Dictionary::cast(properties());
+ return StringDictionary::cast(properties());
}
-Dictionary* JSObject::element_dictionary() {
+NumberDictionary* JSObject::element_dictionary() {
ASSERT(!HasFastElements());
- return Dictionary::cast(elements());
+ return NumberDictionary::cast(elements());
}
@@ -2640,16 +2637,17 @@
set_flag(Smi::FromInt(rest_value | AttributesField::encode(attributes)));
}
-void Dictionary::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->IsString() || details.index() > 0);
- int index = EntryToIndex(entry);
- WriteBarrierMode mode = GetWriteBarrierMode();
- set(index, key, mode);
- set(index+1, value, mode);
- fast_set(this, index+2, details.AsSmi());
+ 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());
}