Commit 94c78e51 authored by ggaren@apple.com's avatar ggaren@apple.com

Removed Blackberry #ifdefs and platform code from JavaScriptCore

https://bugs.webkit.org/show_bug.cgi?id=126757

Reviewed by Sam Weinig.

* PlatformBlackBerry.cmake: Removed.
* heap/HeapTimer.cpp:
* heap/HeapTimer.h:
* heap/IncrementalSweeper.cpp:
* heap/IncrementalSweeper.h:
* jsc.cpp:
(main):
* runtime/GCActivityCallbackBlackBerry.cpp: Removed.
* runtime/MemoryStatistics.cpp:
(JSC::globalMemoryStatistics):


git-svn-id: http://svn.webkit.org/repository/webkit/trunk@161650 268f45cc-cd09-0410-ab3c-d52691b4dbfc
parent 36807810
2014-01-10 Geoffrey Garen <ggaren@apple.com>
Removed Blackberry #ifdefs and platform code from JavaScriptCore
https://bugs.webkit.org/show_bug.cgi?id=126757
Reviewed by Sam Weinig.
* PlatformBlackBerry.cmake: Removed.
* heap/HeapTimer.cpp:
* heap/HeapTimer.h:
* heap/IncrementalSweeper.cpp:
* heap/IncrementalSweeper.h:
* jsc.cpp:
(main):
* runtime/GCActivityCallbackBlackBerry.cpp: Removed.
* runtime/MemoryStatistics.cpp:
(JSC::globalMemoryStatistics):
2014-01-07 Mark Hahnenberg <mhahnenberg@apple.com>
Marking should be generational
......
list(REMOVE_ITEM JavaScriptCore_SOURCES
runtime/GCActivityCallback.cpp
)
list(APPEND JavaScriptCore_SOURCES
runtime/GCActivityCallbackBlackBerry.cpp
)
install(FILES "wtf/Forward.h" DESTINATION usr/include/browser/webkit/wtf)
......@@ -100,30 +100,6 @@ void HeapTimer::timerDidFire(CFRunLoopTimerRef timer, void* context)
apiLock->unlock();
}
#elif PLATFORM(BLACKBERRY)
HeapTimer::HeapTimer(VM* vm)
: m_vm(vm)
, m_timer(this, &HeapTimer::timerDidFire)
{
// FIXME: Implement HeapTimer for other threads.
if (WTF::isMainThread() && !m_timer.tryCreateClient())
CRASH();
}
HeapTimer::~HeapTimer()
{
}
void HeapTimer::timerDidFire()
{
doWork();
}
void HeapTimer::invalidate()
{
}
#elif PLATFORM(EFL)
HeapTimer::HeapTimer(VM* vm)
......
......@@ -31,8 +31,6 @@
#if USE(CF)
#include <CoreFoundation/CoreFoundation.h>
#elif PLATFORM(BLACKBERRY)
#include <BlackBerryPlatformTimer.h>
#elif PLATFORM(EFL)
#if USE(EO)
typedef struct _Eo_Opaque Ecore_Timer;
......@@ -68,10 +66,6 @@ protected:
CFRunLoopTimerContext m_context;
Mutex m_shutdownMutex;
#elif PLATFORM(BLACKBERRY)
void timerDidFire();
BlackBerry::Platform::Timer<HeapTimer> m_timer;
#elif PLATFORM(EFL)
static bool timerEvent(void*);
Ecore_Timer* add(double delay, void* agent);
......
......@@ -38,14 +38,12 @@
namespace JSC {
#if USE(CF) || PLATFORM(BLACKBERRY)
#if USE(CF)
static const double sweepTimeSlice = .01; // seconds
static const double sweepTimeTotal = .10;
static const double sweepTimeMultiplier = 1.0 / sweepTimeTotal;
#if USE(CF)
IncrementalSweeper::IncrementalSweeper(Heap* heap, CFRunLoopRef runLoop)
: HeapTimer(heap->vm(), runLoop)
, m_currentBlockToSweepIndex(0)
......@@ -68,32 +66,6 @@ void IncrementalSweeper::cancelTimer()
CFRunLoopTimerSetNextFireDate(m_timer.get(), CFAbsoluteTimeGetCurrent() + s_decade);
}
#elif PLATFORM(BLACKBERRY)
IncrementalSweeper::IncrementalSweeper(Heap* heap)
: HeapTimer(heap->vm())
, m_currentBlockToSweepIndex(0)
, m_blocksToSweep(heap->m_blockSnapshot)
{
}
PassOwnPtr<IncrementalSweeper> IncrementalSweeper::create(Heap* heap)
{
return adoptPtr(new IncrementalSweeper(heap));
}
void IncrementalSweeper::scheduleTimer()
{
m_timer.start(sweepTimeSlice * sweepTimeMultiplier);
}
void IncrementalSweeper::cancelTimer()
{
m_timer.stop();
}
#endif
void IncrementalSweeper::doWork()
{
doSweep(WTF::monotonicallyIncreasingTime());
......
......@@ -46,13 +46,11 @@ public:
protected:
#if USE(CF)
JS_EXPORT_PRIVATE IncrementalSweeper(Heap*, CFRunLoopRef);
#elif PLATFORM(BLACKBERRY)
IncrementalSweeper(Heap*);
#else
IncrementalSweeper(VM*);
#endif
#if USE(CF) || PLATFORM(BLACKBERRY)
#if USE(CF)
private:
void doSweep(double startTime);
void scheduleTimer();
......
......@@ -85,10 +85,6 @@
#include <arm/arch.h>
#endif
#if PLATFORM(BLACKBERRY)
#include <BlackBerryPlatformLog.h>
#endif
#if PLATFORM(EFL)
#include <Ecore.h>
#endif
......@@ -590,11 +586,6 @@ int main(int argc, char** argv)
timeBeginPeriod(1);
#endif
#if PLATFORM(BLACKBERRY)
// Write all WTF logs to the system log
BlackBerry::Platform::setupApplicationLogging("jsc");
#endif
#if PLATFORM(EFL)
ecore_init();
#endif
......
/*
* Copyright (C) 2012 Research In Motion Limited. All rights reserved.
*
* This library is free software; you can redistribute it and/or
* modify it under the terms of the GNU Lesser General Public
* License as published by the Free Software Foundation; either
* version 2 of the License, or (at your option) any later version.
*
* This library is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
* Lesser General Public License for more details.
*
* You should have received a copy of the GNU Lesser General Public
* License along with this library; if not, write to the Free Software
* Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
*/
#include "config.h"
#include "GCActivityCallback.h"
#include "Heap.h"
#include "VM.h"
#include <BlackBerryPlatformMemory.h>
namespace JSC {
DefaultGCActivityCallback::DefaultGCActivityCallback(Heap* heap)
: GCActivityCallback(heap->vm())
{
}
void DefaultGCActivityCallback::doWork()
{
JSLockHolder lock(m_vm);
m_vm->heap.collect(Heap::DoNotSweep);
}
void DefaultGCActivityCallback::didAllocate(size_t)
{
if (m_timer.started())
return;
// Try using ~5% CPU time.
m_timer.start(m_vm->heap.lastGCLength() * 20);
}
void DefaultGCActivityCallback::willCollect()
{
cancel();
}
void DefaultGCActivityCallback::cancel()
{
m_timer.stop();
}
}
......@@ -37,7 +37,7 @@ GlobalMemoryStatistics globalMemoryStatistics()
GlobalMemoryStatistics stats;
stats.stackBytes = JSStack::committedByteCount();
#if ENABLE(EXECUTABLE_ALLOCATOR_FIXED) || ((PLATFORM(BLACKBERRY) || PLATFORM(EFL)) && ENABLE(JIT))
#if ENABLE(EXECUTABLE_ALLOCATOR_FIXED) || (PLATFORM(EFL) && ENABLE(JIT))
stats.JITBytes = ExecutableAllocator::committedByteCount();
#else
stats.JITBytes = 0;
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment