summaryrefslogtreecommitdiffstats
path: root/V8Binding/v8/src/heap.cc
diff options
context:
space:
mode:
Diffstat (limited to 'V8Binding/v8/src/heap.cc')
-rw-r--r--V8Binding/v8/src/heap.cc53
1 files changed, 46 insertions, 7 deletions
diff --git a/V8Binding/v8/src/heap.cc b/V8Binding/v8/src/heap.cc
index 3b2bd40..c29815e 100644
--- a/V8Binding/v8/src/heap.cc
+++ b/V8Binding/v8/src/heap.cc
@@ -39,6 +39,9 @@
#include "scanner.h"
#include "scopeinfo.h"
#include "v8threads.h"
+#if V8_TARGET_ARCH_ARM && V8_NATIVE_REGEXP
+#include "regexp-macro-assembler.h"
+#endif
namespace v8 {
namespace internal {
@@ -254,6 +257,7 @@ void Heap::ReportStatisticsAfterGC() {
void Heap::GarbageCollectionPrologue() {
+ TranscendentalCache::Clear();
gc_count_++;
#ifdef DEBUG
ASSERT(allocation_allowed_ && gc_state_ == NOT_IN_GC);
@@ -1320,6 +1324,14 @@ void Heap::CreateCEntryStub() {
}
+#if V8_TARGET_ARCH_ARM && V8_NATIVE_REGEXP
+void Heap::CreateRegExpCEntryStub() {
+ RegExpCEntryStub stub;
+ set_re_c_entry_code(*stub.GetCode());
+}
+#endif
+
+
void Heap::CreateCEntryDebugBreakStub() {
CEntryDebugBreakStub stub;
set_c_entry_debug_break_code(*stub.GetCode());
@@ -1356,6 +1368,9 @@ void Heap::CreateFixedStubs() {
Heap::CreateCEntryDebugBreakStub();
Heap::CreateJSEntryStub();
Heap::CreateJSConstructEntryStub();
+#if V8_TARGET_ARCH_ARM && V8_NATIVE_REGEXP
+ Heap::CreateRegExpCEntryStub();
+#endif
}
@@ -3253,15 +3268,13 @@ bool Heap::Setup(bool create_heap_objects) {
void Heap::SetStackLimit(intptr_t limit) {
- // We don't use the stack limit in the roots array on x86-64 yet, but since
- // pointers are generally out of range of Smis we should set the value either.
-#if !V8_HOST_ARCH_64_BIT
+ // On 64 bit machines, pointers are generally out of range of Smis. We write
+ // something that looks like an out of range Smi to the GC.
+
// Set up the special root array entry containing the stack guard.
// This is actually an address, but the tag makes the GC ignore it.
- set_stack_limit(Smi::FromInt(limit >> kSmiTagSize));
-#else
- set_stack_limit(Smi::FromInt(0));
-#endif
+ roots_[kStackLimitRootIndex] =
+ reinterpret_cast<Object*>((limit & ~kSmiTagMask) | kSmiTag);
}
@@ -3974,4 +3987,30 @@ bool Heap::GarbageCollectionGreedyCheck() {
}
#endif
+
+TranscendentalCache::TranscendentalCache(TranscendentalCache::Type t)
+ : type_(t) {
+ uint32_t in0 = 0xffffffffu; // Bit-pattern for a NaN that isn't
+ uint32_t in1 = 0xffffffffu; // generated by the FPU.
+ for (int i = 0; i < kCacheSize; i++) {
+ elements_[i].in[0] = in0;
+ elements_[i].in[1] = in1;
+ elements_[i].output = NULL;
+ }
+}
+
+
+TranscendentalCache* TranscendentalCache::caches_[kNumberOfCaches];
+
+
+void TranscendentalCache::Clear() {
+ for (int i = 0; i < kNumberOfCaches; i++) {
+ if (caches_[i] != NULL) {
+ delete caches_[i];
+ caches_[i] = NULL;
+ }
+ }
+}
+
+
} } // namespace v8::internal