From 9bcd318d5fa2a38139c9651d263a06c797529333 Mon Sep 17 00:00:00 2001 From: Apple Date: Wed, 9 Sep 2009 05:23:36 +0000 Subject: [PATCH] JavaScriptCore-525.tar.gz --- interpreter/Interpreter.cpp | 4 ++-- interpreter/Interpreter.h | 4 +++- wtf/Assertions.cpp.rej | 35 ----------------------------------- wtf/FastMalloc.cpp | 6 +++++- wtf/TCSystemAlloc.cpp | 10 ++-------- 5 files changed, 12 insertions(+), 47 deletions(-) delete mode 100644 wtf/Assertions.cpp.rej diff --git a/interpreter/Interpreter.cpp b/interpreter/Interpreter.cpp index 865e00a..a45773c 100644 --- a/interpreter/Interpreter.cpp +++ b/interpreter/Interpreter.cpp @@ -343,7 +343,7 @@ NEVER_INLINE bool Interpreter::resolveGlobal(CallFrame* callFrame, Instruction* PropertySlot slot(globalObject); if (globalObject->getPropertySlot(callFrame, ident, slot)) { JSValuePtr result = slot.getValue(callFrame, ident); - if (slot.isCacheable() && !globalObject->structure()->isDictionary()) { + if (slot.isCacheable() && !globalObject->structure()->isDictionary() && slot.slotBase() == globalObject) { if (vPC[4].u.structure) vPC[4].u.structure->deref(); globalObject->structure()->ref(); @@ -5338,7 +5338,7 @@ JSValueEncodedAsPointer* Interpreter::cti_op_resolve_global(STUB_ARGS) PropertySlot slot(globalObject); if (globalObject->getPropertySlot(callFrame, ident, slot)) { JSValuePtr result = slot.getValue(callFrame, ident); - if (slot.isCacheable() && !globalObject->structure()->isDictionary()) { + if (slot.isCacheable() && !globalObject->structure()->isDictionary() && slot.slotBase() == globalObject) { GlobalResolveInfo& globalResolveInfo = callFrame->codeBlock()->globalResolveInfo(globalResolveInfoIndex); if (globalResolveInfo.structure) globalResolveInfo.structure->deref(); diff --git a/interpreter/Interpreter.h b/interpreter/Interpreter.h index dc467e3..087be10 100644 --- a/interpreter/Interpreter.h +++ b/interpreter/Interpreter.h @@ -107,7 +107,9 @@ namespace JSC { WillExecuteStatement }; - enum { MaxReentryDepth = 128 }; + // We use a smaller reentrancy limit on iPhone because of the high amount of + // stack space required on the web thread. + enum { MaxReentryDepth = 100 }; class Interpreter { friend class JIT; diff --git a/wtf/Assertions.cpp.rej b/wtf/Assertions.cpp.rej deleted file mode 100644 index d6043c6..0000000 --- a/wtf/Assertions.cpp.rej +++ /dev/null @@ -1,35 +0,0 @@ -*************** -*** 63,88 **** - CFRelease(str); - CFRelease(cfFormat); - } else -- #elif COMPILER(MSVC) && !PLATFORM(WIN_CE) -- if (IsDebuggerPresent()) { -- size_t size = 1024; -- -- do { -- char* buffer = (char*)malloc(size); -- -- if (buffer == NULL) -- break; -- -- if (_vsnprintf(buffer, size, format, args) != -1) { -- OutputDebugStringA(buffer); -- free(buffer); -- break; -- } -- -- free(buffer); -- size *= 2; -- } while (size > 1024); -- } - vfprintf(stderr, format, args); - } - ---- 63,68 ---- - CFRelease(str); - CFRelease(cfFormat); - } else - vfprintf(stderr, format, args); - } - diff --git a/wtf/FastMalloc.cpp b/wtf/FastMalloc.cpp index 468aaac..15c42b2 100644 --- a/wtf/FastMalloc.cpp +++ b/wtf/FastMalloc.cpp @@ -82,6 +82,8 @@ #include #endif +#include + #ifndef NO_TCMALLOC_SAMPLES #ifdef WTF_CHANGES #define NO_TCMALLOC_SAMPLES @@ -3806,7 +3808,8 @@ void* FastMallocZone::zoneRealloc(malloc_zone_t*, void*, size_t) extern "C" { malloc_introspection_t jscore_fastmalloc_introspection = { &FastMallocZone::enumerate, &FastMallocZone::goodSize, &FastMallocZone::check, &FastMallocZone::print, - &FastMallocZone::log, &FastMallocZone::forceLock, &FastMallocZone::forceUnlock, &FastMallocZone::statistics }; + &FastMallocZone::log, &FastMallocZone::forceLock, &FastMallocZone::forceUnlock, &FastMallocZone::statistics + }; } FastMallocZone::FastMallocZone(TCMalloc_PageHeap* pageHeap, TCMalloc_ThreadCache** threadHeaps, TCMalloc_Central_FreeListPadded* centralCaches) @@ -3815,6 +3818,7 @@ FastMallocZone::FastMallocZone(TCMalloc_PageHeap* pageHeap, TCMalloc_ThreadCache , m_centralCaches(centralCaches) { memset(&m_zone, 0, sizeof(m_zone)); + m_zone.version = 4; m_zone.zone_name = "JavaScriptCore FastMalloc"; m_zone.size = &FastMallocZone::size; m_zone.malloc = &FastMallocZone::zoneMalloc; diff --git a/wtf/TCSystemAlloc.cpp b/wtf/TCSystemAlloc.cpp index 1aeb99e..df1aa33 100644 --- a/wtf/TCSystemAlloc.cpp +++ b/wtf/TCSystemAlloc.cpp @@ -55,12 +55,6 @@ #define MAP_ANONYMOUS MAP_ANON #endif -#if PLATFORM(DARWIN) && defined(VM_MEMORY_TCMALLOC) -static const int mmapFileDescriptor = VM_MAKE_TAG(VM_MEMORY_TCMALLOC); -#else -static const int mmapFileDescriptor = -1; -#endif - // Structure for discovering alignment union MemoryAligner { void* p; @@ -178,7 +172,7 @@ static void* TryMmap(size_t size, size_t *actual_size, size_t alignment) { void* result = mmap(NULL, size + extra, PROT_READ | PROT_WRITE, MAP_PRIVATE|MAP_ANONYMOUS, - mmapFileDescriptor, 0); + -1, 0); if (result == reinterpret_cast(MAP_FAILED)) { mmap_failure = true; return NULL; @@ -430,7 +424,7 @@ void TCMalloc_SystemRelease(void* start, size_t length) #endif #if HAVE(MMAP) - void* newAddress = mmap(start, length, PROT_READ | PROT_WRITE, MAP_PRIVATE | MAP_ANONYMOUS | MAP_FIXED, mmapFileDescriptor, 0); + void* newAddress = mmap(start, length, PROT_READ | PROT_WRITE, MAP_PRIVATE | MAP_ANONYMOUS | MAP_FIXED, -1, 0); // If the mmap failed then that's ok, we just won't return the memory to the system. ASSERT_UNUSED(newAddress, newAddress == start || newAddress == reinterpret_cast(MAP_FAILED)); return; -- 2.45.2