Version 2.3.4
Fixed warnings on arm on newer GCC versions.
Fixed a number of minor bugs.
Performance improvements on all platforms.
git-svn-id: http://v8.googlecode.com/svn/trunk@4453 ce2b1a6d-e550-0410-aec6-3dcde31c8c00
diff --git a/src/heap.cc b/src/heap.cc
index 7a5188f..eb47884 100644
--- a/src/heap.cc
+++ b/src/heap.cc
@@ -41,7 +41,7 @@
#include "scopeinfo.h"
#include "snapshot.h"
#include "v8threads.h"
-#if V8_TARGET_ARCH_ARM && V8_NATIVE_REGEXP
+#if V8_TARGET_ARCH_ARM && !V8_INTERPRETED_REGEXP
#include "regexp-macro-assembler.h"
#include "arm/regexp-macro-assembler-arm.h"
#endif
@@ -1444,10 +1444,6 @@
if (obj->IsFailure()) return false;
set_global_context_map(Map::cast(obj));
- obj = AllocateMap(JS_FUNCTION_TYPE, JSFunction::kSize);
- if (obj->IsFailure()) return false;
- set_boilerplate_function_map(Map::cast(obj));
-
obj = AllocateMap(SHARED_FUNCTION_INFO_TYPE,
SharedFunctionInfo::kAlignedSize);
if (obj->IsFailure()) return false;
@@ -1531,7 +1527,7 @@
}
-#if V8_TARGET_ARCH_ARM && V8_NATIVE_REGEXP
+#if V8_TARGET_ARCH_ARM && !V8_INTERPRETED_REGEXP
void Heap::CreateRegExpCEntryStub() {
RegExpCEntryStub stub;
set_re_c_entry_code(*stub.GetCode());
@@ -1568,7 +1564,7 @@
Heap::CreateCEntryStub();
Heap::CreateJSEntryStub();
Heap::CreateJSConstructEntryStub();
-#if V8_TARGET_ARCH_ARM && V8_NATIVE_REGEXP
+#if V8_TARGET_ARCH_ARM && !V8_INTERPRETED_REGEXP
Heap::CreateRegExpCEntryStub();
#endif
}
@@ -1670,8 +1666,8 @@
if (InitializeNumberStringCache()->IsFailure()) return false;
- // Allocate cache for single character strings.
- obj = AllocateFixedArray(String::kMaxAsciiCharCode+1, TENURED);
+ // Allocate cache for single character ASCII strings.
+ obj = AllocateFixedArray(String::kMaxAsciiCharCode + 1, TENURED);
if (obj->IsFailure()) return false;
set_single_character_string_cache(FixedArray::cast(obj));
@@ -3013,13 +3009,10 @@
}
-Object* Heap::AllocateFixedArray(int length, PretenureFlag pretenure) {
- ASSERT(length >= 0);
- ASSERT(empty_fixed_array()->IsFixedArray());
+Object* Heap::AllocateRawFixedArray(int length, PretenureFlag pretenure) {
if (length < 0 || length > FixedArray::kMaxLength) {
return Failure::OutOfMemoryException();
}
- if (length == 0) return empty_fixed_array();
AllocationSpace space =
(pretenure == TENURED) ? OLD_POINTER_SPACE : NEW_SPACE;
@@ -3053,18 +3046,39 @@
ASSERT(space == LO_SPACE);
result = lo_space_->AllocateRawFixedArray(size);
}
+ return result;
+}
+
+
+static Object* AllocateFixedArrayWithFiller(int length,
+ PretenureFlag pretenure,
+ Object* filler) {
+ ASSERT(length >= 0);
+ ASSERT(Heap::empty_fixed_array()->IsFixedArray());
+ if (length == 0) return Heap::empty_fixed_array();
+
+ ASSERT(!Heap::InNewSpace(filler));
+ Object* result = Heap::AllocateRawFixedArray(length, pretenure);
if (result->IsFailure()) return result;
- // Initialize the object.
- reinterpret_cast<Array*>(result)->set_map(fixed_array_map());
+ HeapObject::cast(result)->set_map(Heap::fixed_array_map());
FixedArray* array = FixedArray::cast(result);
array->set_length(length);
- ASSERT(!Heap::InNewSpace(undefined_value()));
- MemsetPointer(array->data_start(), undefined_value(), length);
+ MemsetPointer(array->data_start(), filler, length);
return array;
}
+Object* Heap::AllocateFixedArray(int length, PretenureFlag pretenure) {
+ return AllocateFixedArrayWithFiller(length, pretenure, undefined_value());
+}
+
+
+Object* Heap::AllocateFixedArrayWithHoles(int length, PretenureFlag pretenure) {
+ return AllocateFixedArrayWithFiller(length, pretenure, the_hole_value());
+}
+
+
Object* Heap::AllocateUninitializedFixedArray(int length) {
if (length == 0) return empty_fixed_array();
@@ -3077,22 +3091,6 @@
}
-Object* Heap::AllocateFixedArrayWithHoles(int length) {
- if (length == 0) return empty_fixed_array();
- Object* result = AllocateRawFixedArray(length);
- if (!result->IsFailure()) {
- // Initialize header.
- reinterpret_cast<Array*>(result)->set_map(fixed_array_map());
- FixedArray* array = FixedArray::cast(result);
- array->set_length(length);
- // Initialize body.
- ASSERT(!Heap::InNewSpace(the_hole_value()));
- MemsetPointer(array->data_start(), the_hole_value(), length);
- }
- return result;
-}
-
-
Object* Heap::AllocateHashTable(int length, PretenureFlag pretenure) {
Object* result = Heap::AllocateFixedArray(length, pretenure);
if (result->IsFailure()) return result;