Commit 6ef23cde authored by mrowe@apple.com's avatar mrowe@apple.com

2008-05-23 Darin Adler <darin@apple.com>

        Reviewed by Mark Rowe.

        As allocateNumber is used via jsNumberCell outside of JavaScriptCore,
        we need to provide a non-inlined version of it to avoid creating a
        weak external symbol.

        * JavaScriptCore.exp:
        * kjs/AllInOneFile.cpp:
        * kjs/collector.cpp:
        (KJS::Collector::allocate):
        (KJS::Collector::allocateNumber):
        * kjs/collector.h:
        (KJS::Collector::allocate):
        (KJS::Collector::inlineAllocateNumber):
        * kjs/value.h:
        (KJS::NumberImp::operator new):


git-svn-id: http://svn.webkit.org/repository/webkit/trunk@34088 268f45cc-cd09-0410-ab3c-d52691b4dbfc
parent 27030d4a
2008-05-23 Darin Adler <darin@apple.com>
Reviewed by Mark Rowe.
As allocateNumber is used via jsNumberCell outside of JavaScriptCore,
we need to provide a non-inlined version of it to avoid creating a
weak external symbol.
* JavaScriptCore.exp:
* kjs/AllInOneFile.cpp:
* kjs/collector.cpp:
(KJS::Collector::allocate):
(KJS::Collector::allocateNumber):
* kjs/collector.h:
(KJS::Collector::allocate):
(KJS::Collector::inlineAllocateNumber):
* kjs/value.h:
(KJS::NumberImp::operator new):
2008-05-23 Geoffrey Garen <ggaren@apple.com>
Rolled out r34073 because it caused lots of layout test crashes.
......
......@@ -90,9 +90,7 @@ __ZN3KJS11Interpreter8evaluateEPNS_9ExecStateERNS_10ScopeChainERKNS_7UStringEiN3
__ZN3KJS11Interpreter8evaluateEPNS_9ExecStateERNS_10ScopeChainERKNS_7UStringEiS7_PNS_7JSValueE
__ZN3KJS11JSImmediate8toObjectEPKNS_7JSValueEPNS_9ExecStateE
__ZN3KJS11JSImmediate8toStringEPKNS_7JSValueE
__ZN3KJS11ProfileNode5focusERKNS_14CallIdentifierEb
__ZN3KJS11ProfileNode10restoreAllEv
__ZN3KJS11ProfileNode7excludeERKNS_14CallIdentifierE
__ZN3KJS11ProfileNode18sortCallsAscendingEv
__ZN3KJS11ProfileNode19sortCallsDescendingEv
__ZN3KJS11ProfileNode21sortSelfTimeAscendingEv
......@@ -101,6 +99,8 @@ __ZN3KJS11ProfileNode22sortTotalTimeAscendingEv
__ZN3KJS11ProfileNode23sortTotalTimeDescendingEv
__ZN3KJS11ProfileNode25sortFunctionNameAscendingEv
__ZN3KJS11ProfileNode26sortFunctionNameDescendingEv
__ZN3KJS11ProfileNode5focusERKNS_14CallIdentifierEb
__ZN3KJS11ProfileNode7excludeERKNS_14CallIdentifierE
__ZN3KJS11ProgramNode6createEPNS_14SourceElementsEPN3WTF6VectorISt4pairINS_10IdentifierEjELm16EEEPNS4_IPNS_12FuncDeclNodeELm16EEEbb
__ZN3KJS11PropertyMap11getLocationERKNS_10IdentifierE
__ZN3KJS11PropertyMap11getLocationERKNS_10IdentifierERb
......@@ -109,7 +109,6 @@ __ZN3KJS11PropertyMap5clearEv
__ZN3KJS11PropertyMapD1Ev
__ZN3KJS12DateInstance4infoE
__ZN3KJS12PropertySlot15undefinedGetterEPNS_9ExecStateEPNS_8JSObjectERKNS_10IdentifierERKS0_
__ZN3KJS12jsNumberCellEd
__ZN3KJS13ArrayInstance4infoE
__ZN3KJS13CodeGenerator21setDumpsGeneratedCodeEb
__ZN3KJS13StatementNode6setLocEii
......@@ -120,7 +119,6 @@ __ZN3KJS14JSGlobalObject12defineSetterEPNS_9ExecStateERKNS_10IdentifierEPNS_8JSO
__ZN3KJS14JSGlobalObject16stopTimeoutCheckEv
__ZN3KJS14JSGlobalObject17putWithAttributesEPNS_9ExecStateERKNS_10IdentifierEPNS_7JSValueEj
__ZN3KJS14JSGlobalObject17startTimeoutCheckEv
__ZN3KJS14JSGlobalObject18getOwnPropertySlotEPNS_9ExecStateERKNS_10IdentifierERNS_12PropertySlotE
__ZN3KJS14JSGlobalObject3putEPNS_9ExecStateERKNS_10IdentifierEPNS_7JSValueE
__ZN3KJS14JSGlobalObject4initEPNS_8JSObjectE
__ZN3KJS14JSGlobalObject4markEv
......@@ -208,7 +206,7 @@ __ZN3KJS8Profiler14startProfilingEPNS_9ExecStateERKNS_7UStringE
__ZN3KJS8Profiler8profilerEv
__ZN3KJS8jsStringEPKc
__ZN3KJS8jsStringERKNS_7UStringE
__ZN3KJS9Collector12heapAllocateILNS0_8HeapTypeE1EEEPvm
__ZN3KJS9Collector14allocateNumberEm
__ZN3KJS9Collector15recordExtraCostEm
__ZN3KJS9Collector17globalObjectCountEv
__ZN3KJS9Collector20protectedObjectCountEv
......
......@@ -23,6 +23,7 @@
// that see a significant speed gain from this.
#define KDE_USE_FINAL 1
#define JAVASCRIPTCORE_BUILDING_ALL_IN_ONE_FILE 1
#include "config.h"
#include "function.cpp"
......
......@@ -291,17 +291,18 @@ collect:
return newCell;
}
#if !PLATFORM(MAC)
#ifndef JAVASCRIPTCORE_BUILDING_ALL_IN_ONE_FILE
void* Collector::allocate(size_t s)
{
return heapAllocate<PrimaryHeap>(s);
}
#endif
void* Collector::allocateNumber(size_t s)
{
return heapAllocate<NumberHeap>(s);
}
#endif
static inline void* currentThreadStackBase()
{
......
......@@ -38,17 +38,17 @@ namespace KJS {
class Thread;
enum HeapType { PrimaryHeap, NumberHeap };
#if PLATFORM(MAC)
// We can inline these functions on Mac because everything is compiled as
#ifdef JAVASCRIPTCORE_BUILDING_ALL_IN_ONE_FILE
// We can inline these functions because everything is compiled as
// one file, so the heapAllocate template definitions are available.
// FIXME: This should be enabled for all platforms using AllInOneFile.cpp
// However, allocateNumber is used via jsNumberCell outside JavaScriptCore.
// Thus allocateNumber needs to provide a non-inline version too.
static void* allocate(size_t s) { return heapAllocate<PrimaryHeap>(s); }
static void* allocateNumber(size_t s) { return heapAllocate<NumberHeap>(s); }
static void* inlineAllocateNumber(size_t s) { return heapAllocate<NumberHeap>(s); }
#else
static void* allocate(size_t s);
static void* allocateNumber(size_t s);
static void* allocate(size_t);
#endif
static void* allocateNumber(size_t s);
static bool collect();
static bool isBusy(); // true if an allocation or collection is in progress
......
......@@ -199,7 +199,11 @@ public:
void* operator new(size_t size)
{
#ifdef JAVASCRIPTCORE_BUILDING_ALL_IN_ONE_FILE
return Collector::inlineAllocateNumber(size);
#else
return Collector::allocateNumber(size);
#endif
}
private:
......
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