JavaScriptCore:
[WebKit-https.git] / JavaScriptCore / runtime / Collector.cpp
index 6537299..68ca717 100644 (file)
 
 #include "ArgList.h"
 #include "CollectorHeapIterator.h"
-#include "ExecState.h"
+#include "CallFrame.h"
 #include "JSGlobalObject.h"
 #include "JSLock.h"
 #include "JSString.h"
 #include "JSValue.h"
-#include "Machine.h"
+#include "Interpreter.h"
 #include "Tracing.h"
 #include <algorithm>
 #include <setjmp.h>
@@ -189,6 +189,10 @@ static NEVER_INLINE CollectorBlock* allocateBlock()
     vm_address_t address = 0;
     // FIXME: tag the region as a JavaScriptCore heap when we get a registered VM tag: <rdar://problem/6054788>.
     vm_map(current_task(), &address, BLOCK_SIZE, BLOCK_OFFSET_MASK, VM_FLAGS_ANYWHERE, MEMORY_OBJECT_NULL, 0, FALSE, VM_PROT_DEFAULT, VM_PROT_DEFAULT, VM_INHERIT_DEFAULT);
+#elif PLATFORM(SYMBIAN)
+    // no memory map in symbian, need to hack with fastMalloc
+    void* address = fastMalloc(BLOCK_SIZE);
+    memset(reinterpret_cast<void*>(address), 0, BLOCK_SIZE);
 #elif PLATFORM(WIN_OS)
      // windows virtual address granularity is naturally 64k
     LPVOID address = VirtualAlloc(NULL, BLOCK_SIZE, MEM_COMMIT | MEM_RESERVE, PAGE_READWRITE);
@@ -231,6 +235,8 @@ static void freeBlock(CollectorBlock* block)
 {
 #if PLATFORM(DARWIN)    
     vm_deallocate(current_task(), reinterpret_cast<vm_address_t>(block), BLOCK_SIZE);
+#elif PLATFORM(SYMBIAN)
+    fastFree(block);
 #elif PLATFORM(WIN_OS)
     VirtualFree(block, 0, MEM_RELEASE);
 #elif HAVE(POSIX_MEMALIGN)
@@ -975,17 +981,9 @@ bool Heap::collect()
         ArgList::markLists(*m_markListSet);
     if (m_globalData->exception && !m_globalData->exception->marked())
         m_globalData->exception->mark();
-    m_globalData->machine->registerFile().markCallFrames(this);
+    m_globalData->interpreter->registerFile().markCallFrames(this);
     m_globalData->smallStrings.mark();
 
-    JSGlobalObject* globalObject = m_globalData->head;
-    if (globalObject) {
-        do {
-            globalObject->markCrossHeapDependentObjects();
-            globalObject = globalObject->next();
-        } while (globalObject != m_globalData->head);
-    }
-
     JAVASCRIPTCORE_GC_MARKED();
 
     size_t originalLiveObjects = primaryHeap.numLiveObjects + numberHeap.numLiveObjects;