Changeset 76248 in webkit for trunk/Source/JavaScriptCore


Ignore:
Timestamp:
Jan 20, 2011, 8:30:54 AM (14 years ago)
Author:
Csaba Osztrogonác
Message:

Refactoring of the custom allocation framework
https://bugs.webkit.org/show_bug.cgi?id=49897

Patch by Zoltan Horvath <[email protected]> on 2011-01-20
Reviewed by Csaba Osztrogonác.

Source/JavaScriptCore:

Inheriting from FastAllocBase can result in objects getting larger (bug #33896, #46589).
The modification replaces Noncopyable and FastAllocBase classes and these inherits with their
equivalent macro implementation at the necessary places.

  • wtf/FastAllocBase.h: Turn FastAllocBase's implementation into a macro.

Source/WebCore:

Inheriting from FastAllocBase can result in objects getting larger (bug #33896, #46589).
The modification replaces Noncopyable and FastAllocBase classes and these inherits with their
equivalent macro implementation at the necessary places.

Source/WebKit:

Inheriting from FastAllocBase can result in objects getting larger (bug #33896, #46589).
The modification replaces Noncopyable and FastAllocBase classes and these inherits with their
equivalent macro implementation at the necessary places.

Source/WebKit2:

Inheriting from FastAllocBase can result in objects getting larger (bug #33896, #46589).
The modification replaces Noncopyable and FastAllocBase classes and these inherits with their
equivalent macro implementation at the necessary places.

Tools:

Inheriting from FastAllocBase can result in objects getting larger (bug #33896, #46589).
The modification replaces Noncopyable and FastAllocBase classes and these inherits with their
equivalent macro implementation at the necessary places.

Location:
trunk/Source/JavaScriptCore
Files:
72 edited

Legend:

Unmodified
Added
Removed
  • trunk/Source/JavaScriptCore/API/JSClassRef.h

    r65104 r76248  
    3535#include <wtf/HashMap.h>
    3636
    37 struct StaticValueEntry : FastAllocBase {
     37struct StaticValueEntry {
     38    WTF_MAKE_FAST_ALLOCATED;
     39public:
    3840    StaticValueEntry(JSObjectGetPropertyCallback _getProperty, JSObjectSetPropertyCallback _setProperty, JSPropertyAttributes _attributes)
    3941        : getProperty(_getProperty), setProperty(_setProperty), attributes(_attributes)
     
    4648};
    4749
    48 struct StaticFunctionEntry : FastAllocBase {
     50struct StaticFunctionEntry {
     51    WTF_MAKE_FAST_ALLOCATED;
     52public:
    4953    StaticFunctionEntry(JSObjectCallAsFunctionCallback _callAsFunction, JSPropertyAttributes _attributes)
    5054        : callAsFunction(_callAsFunction), attributes(_attributes)
     
    6367// An OpaqueJSClass (JSClass) is created without a context, so it can be used with any context, even across context groups.
    6468// This structure holds data members that vary across context groups.
    65 struct OpaqueJSClassContextData : Noncopyable {
     69struct OpaqueJSClassContextData {
     70    WTF_MAKE_NONCOPYABLE(OpaqueJSClassContextData); WTF_MAKE_FAST_ALLOCATED;
     71public:
    6672    OpaqueJSClassContextData(OpaqueJSClass*);
    6773    ~OpaqueJSClassContextData();
  • trunk/Source/JavaScriptCore/API/JSObjectRef.cpp

    r71375 r76248  
    481481}
    482482
    483 struct OpaqueJSPropertyNameArray : FastAllocBase {
     483struct OpaqueJSPropertyNameArray {
     484    WTF_MAKE_FAST_ALLOCATED;
     485public:
    484486    OpaqueJSPropertyNameArray(JSGlobalData* globalData)
    485487        : refCount(0)
  • trunk/Source/JavaScriptCore/ChangeLog

    r76214 r76248  
     12011-01-20  Zoltan Horvath  <[email protected]>
     2
     3        Reviewed by Csaba Osztrogonác.
     4
     5        Refactoring of the custom allocation framework
     6        https://bugs.webkit.org/show_bug.cgi?id=49897
     7
     8        Inheriting from FastAllocBase can result in objects getting larger (bug #33896, #46589).
     9        The modification replaces Noncopyable and FastAllocBase classes and these inherits with their
     10        equivalent macro implementation at the necessary places.
     11
     12        * wtf/FastAllocBase.h: Turn FastAllocBase's implementation into a macro.
     13
    1142011-01-20  Mark Rowe  <[email protected]>
    215
  • trunk/Source/JavaScriptCore/assembler/LinkBuffer.h

    r73321 r76248  
    5151//   * The value referenced by a DataLabel may be set.
    5252//
    53 class LinkBuffer : public Noncopyable {
     53class LinkBuffer {
     54    WTF_MAKE_NONCOPYABLE(LinkBuffer);
    5455    typedef MacroAssemblerCodeRef CodeRef;
    5556    typedef MacroAssemblerCodePtr CodePtr;
  • trunk/Source/JavaScriptCore/bytecode/CodeBlock.h

    r72442 r76248  
    243243#endif
    244244
    245     class CodeBlock : public FastAllocBase {
     245    class CodeBlock {
     246        WTF_MAKE_FAST_ALLOCATED;
    246247        friend class JIT;
    247248    protected:
     
    579580        SymbolTable* m_symbolTable;
    580581
    581         struct RareData : FastAllocBase {
     582        struct RareData {
     583           WTF_MAKE_FAST_ALLOCATED;
     584        public:
    582585            Vector<HandlerInfo> m_exceptionHandlers;
    583586
     
    600603#endif
    601604        };
     605#if PLATFORM(WIN)
     606        friend void WTF::deleteOwnedPtr<RareData>(RareData*);
     607#endif
    602608        OwnPtr<RareData> m_rareData;
    603609    };
  • trunk/Source/JavaScriptCore/bytecode/Instruction.h

    r64943 r76248  
    5555
    5656    // Structure used by op_get_by_id_self_list and op_get_by_id_proto_list instruction to hold data off the main opcode stream.
    57     struct PolymorphicAccessStructureList : FastAllocBase {
     57    struct PolymorphicAccessStructureList {
     58        WTF_MAKE_FAST_ALLOCATED;
     59    public:
    5860        struct PolymorphicStubInfo {
    5961            bool isChain;
  • trunk/Source/JavaScriptCore/bytecode/SamplingTool.h

    r48905 r76248  
    143143       
    144144#if ENABLE(OPCODE_SAMPLING)
    145         class CallRecord : public Noncopyable {
     145        class CallRecord {
     146            WTF_MAKE_NONCOPYABLE(CallRecord);
    146147        public:
    147148            CallRecord(SamplingTool* samplingTool)
     
    173174        };
    174175#else
    175         class CallRecord : public Noncopyable {
     176        class CallRecord {
     177            WTF_MAKE_NONCOPYABLE(CallRecord);
    176178        public:
    177179            CallRecord(SamplingTool*)
  • trunk/Source/JavaScriptCore/bytecompiler/BytecodeGenerator.h

    r75408 r76248  
    4141#include "Debugger.h"
    4242#include "Nodes.h"
    43 #include <wtf/FastAllocBase.h>
    4443#include <wtf/PassRefPtr.h>
    4544#include <wtf/SegmentedVector.h>
     
    8685    };
    8786
    88     class BytecodeGenerator : public FastAllocBase {
     87    class BytecodeGenerator {
     88        WTF_MAKE_FAST_ALLOCATED;
    8989    public:
    9090        typedef DeclarationStacks::VarStack VarStack;
  • trunk/Source/JavaScriptCore/bytecompiler/RegisterID.h

    r45891 r76248  
    3131
    3232#include <wtf/Assertions.h>
    33 #include <wtf/Noncopyable.h>
    3433#include <wtf/VectorTraits.h>
    3534
    3635namespace JSC {
    3736
    38     class RegisterID : public Noncopyable {
     37    class RegisterID {
     38        WTF_MAKE_NONCOPYABLE(RegisterID);
    3939    public:
    4040        RegisterID()
  • trunk/Source/JavaScriptCore/interpreter/CachedCall.h

    r70703 r76248  
    3333
    3434namespace JSC {
    35     class CachedCall : public Noncopyable {
     35    class CachedCall {
     36        WTF_MAKE_NONCOPYABLE(CachedCall); WTF_MAKE_FAST_ALLOCATED;
    3637    public:
    3738        CachedCall(CallFrame* callFrame, JSFunction* function, int argCount)
  • trunk/Source/JavaScriptCore/interpreter/Interpreter.h

    r72360 r76248  
    3131
    3232#include "ArgList.h"
    33 #include "FastAllocBase.h"
    3433#include "JSCell.h"
    3534#include "JSValue.h"
     
    6665    enum { MaxLargeThreadReentryDepth = 256, MaxSmallThreadReentryDepth = 32 };
    6766
    68     class Interpreter : public FastAllocBase {
     67    class Interpreter {
     68        WTF_MAKE_FAST_ALLOCATED;
    6969        friend class JIT;
    7070        friend class CachedCall;
  • trunk/Source/JavaScriptCore/interpreter/Register.h

    r60392 r76248  
    3232#include "JSValue.h"
    3333#include <wtf/Assertions.h>
    34 #include <wtf/FastAllocBase.h>
    3534#include <wtf/VectorTraits.h>
    3635
     
    4847    typedef ExecState CallFrame;
    4948
    50     class Register : public WTF::FastAllocBase {
     49    class Register {
     50        WTF_MAKE_FAST_ALLOCATED;
    5151    public:
    5252        Register();
  • trunk/Source/JavaScriptCore/interpreter/RegisterFile.h

    r76193 r76248  
    9090    class JSGlobalObject;
    9191
    92     class RegisterFile : public Noncopyable {
     92    class RegisterFile {
     93        WTF_MAKE_NONCOPYABLE(RegisterFile);
    9394        friend class JIT;
    9495    public:
  • trunk/Source/JavaScriptCore/parser/Lexer.h

    r76177 r76248  
    3838    class RegExp;
    3939
    40     class Lexer : public Noncopyable {
     40    class Lexer {
     41        WTF_MAKE_NONCOPYABLE(Lexer); WTF_MAKE_FAST_ALLOCATED;
    4142    public:
    4243        // Character manipulation functions.
  • trunk/Source/JavaScriptCore/parser/Nodes.h

    r75408 r76248  
    13771377    };
    13781378
    1379     struct ScopeNodeData : FastAllocBase {
     1379    struct ScopeNodeData {
     1380        WTF_MAKE_FAST_ALLOCATED;
     1381    public:
    13801382        typedef DeclarationStacks::VarStack VarStack;
    13811383        typedef DeclarationStacks::FunctionStack FunctionStack;
     
    14731475
    14741476    class FunctionParameters : public Vector<Identifier>, public RefCounted<FunctionParameters> {
     1477        WTF_MAKE_FAST_ALLOCATED;
    14751478    public:
    14761479        static PassRefPtr<FunctionParameters> create(ParameterNode* firstParameter) { return adoptRef(new FunctionParameters(firstParameter)); }
  • trunk/Source/JavaScriptCore/parser/Parser.h

    r76129 r76248  
    4646    template <typename T> struct ParserArenaData : ParserArenaDeletable { T data; };
    4747
    48     class Parser : public Noncopyable {
     48    class Parser {
     49        WTF_MAKE_NONCOPYABLE(Parser); WTF_MAKE_FAST_ALLOCATED;
    4950    public:
     51        Parser() { }
    5052        template <class ParsedNode>
    5153        PassRefPtr<ParsedNode> parse(JSGlobalObject* lexicalGlobalObject, Debugger*, ExecState*, const SourceCode& source, FunctionParameters*, JSParserStrictness strictness, JSObject** exception);
  • trunk/Source/JavaScriptCore/parser/ParserArena.h

    r65177 r76248  
    3535    class ParserArenaRefCounted;
    3636
    37     class IdentifierArena : public FastAllocBase {
     37    class IdentifierArena {
     38        WTF_MAKE_FAST_ALLOCATED;
    3839    public:
    3940        ALWAYS_INLINE const Identifier& makeIdentifier(JSGlobalData*, const UChar* characters, size_t length);
     
    6061    }
    6162
    62     class ParserArena : Noncopyable {
     63    class ParserArena {
     64        WTF_MAKE_NONCOPYABLE(ParserArena);
    6365    public:
    6466        ParserArena();
  • trunk/Source/JavaScriptCore/pcre/pcre_exec.cpp

    r75247 r76248  
    113113};
    114114
    115 struct MatchFrame : FastAllocBase {
     115struct MatchFrame {
     116    WTF_MAKE_FAST_ALLOCATED;
     117public:
    116118    ReturnLocation returnLocation;
    117119    struct MatchFrame* previousFrame;
  • trunk/Source/JavaScriptCore/profiler/CallIdentifier.h

    r72592 r76248  
    2929
    3030#include <runtime/UString.h>
    31 #include "FastAllocBase.h"
    3231#include <wtf/text/CString.h>
    3332#include <wtf/text/StringHash.h>
     
    3534namespace JSC {
    3635
    37     struct CallIdentifier : public FastAllocBase {
     36    struct CallIdentifier {
     37        WTF_MAKE_FAST_ALLOCATED;
     38    public:
    3839        UString m_name;
    3940        UString m_url;
  • trunk/Source/JavaScriptCore/profiler/Profiler.h

    r72351 r76248  
    4545    struct CallIdentifier;   
    4646
    47     class Profiler : public FastAllocBase {
     47    class Profiler {
     48        WTF_MAKE_FAST_ALLOCATED;
    4849    public:
    4950        static Profiler** enabledProfilerReference()
  • trunk/Source/JavaScriptCore/runtime/ArgList.h

    r60392 r76248  
    2626#include "Register.h"
    2727#include <wtf/HashSet.h>
    28 #include <wtf/Noncopyable.h>
    2928#include <wtf/Vector.h>
    3029
     
    3332    class MarkStack;
    3433
    35     class MarkedArgumentBuffer : public Noncopyable {
     34    class MarkedArgumentBuffer {
     35        WTF_MAKE_NONCOPYABLE(MarkedArgumentBuffer);
    3636    private:
    3737        static const unsigned inlineCapacity = 8;
  • trunk/Source/JavaScriptCore/runtime/Arguments.h

    r69516 r76248  
    3434namespace JSC {
    3535
    36     struct ArgumentsData : Noncopyable {
     36    struct ArgumentsData {
     37        WTF_MAKE_NONCOPYABLE(ArgumentsData); WTF_MAKE_FAST_ALLOCATED;
     38    public:
     39        ArgumentsData() { }
    3740        JSActivation* activation;
    3841
  • trunk/Source/JavaScriptCore/runtime/BatchedTransitionOptimizer.h

    r50704 r76248  
    2828#define BatchedTransitionOptimizer_h
    2929
    30 #include <wtf/Noncopyable.h>
    3130#include "JSObject.h"
    3231
    3332namespace JSC {
    3433
    35     class BatchedTransitionOptimizer : public Noncopyable {
     34    class BatchedTransitionOptimizer {
     35        WTF_MAKE_NONCOPYABLE(BatchedTransitionOptimizer);
    3636    public:
    3737        BatchedTransitionOptimizer(JSObject* object)
  • trunk/Source/JavaScriptCore/runtime/CommonIdentifiers.h

    r69516 r76248  
    8585namespace JSC {
    8686
    87     class CommonIdentifiers : public Noncopyable {
     87    class CommonIdentifiers {
     88        WTF_MAKE_NONCOPYABLE(CommonIdentifiers); WTF_MAKE_FAST_ALLOCATED;
    8889    private:
    8990        CommonIdentifiers(JSGlobalData*);
  • trunk/Source/JavaScriptCore/runtime/Heap.h

    r75855 r76248  
    4646    enum OperationInProgress { NoOperation, Allocation, Collection };
    4747
    48     class Heap : public Noncopyable {
     48    class Heap {
     49        WTF_MAKE_NONCOPYABLE(Heap);
    4950    public:
    5051        void destroy();
  • trunk/Source/JavaScriptCore/runtime/JSGlobalObject.h

    r74454 r76248  
    466466    }
    467467
    468     class DynamicGlobalObjectScope : public Noncopyable {
     468    class DynamicGlobalObjectScope {
     469        WTF_MAKE_NONCOPYABLE(DynamicGlobalObjectScope);
    469470    public:
    470471        DynamicGlobalObjectScope(CallFrame* callFrame, JSGlobalObject* dynamicGlobalObject);
  • trunk/Source/JavaScriptCore/runtime/JSLock.h

    r64585 r76248  
    5454    enum JSLockBehavior { SilenceAssertionsOnly, LockForReal };
    5555
    56     class JSLock : public Noncopyable {
     56    class JSLock {
     57        WTF_MAKE_NONCOPYABLE(JSLock);
    5758    public:
    5859        JSLock(ExecState*);
     
    9091        JSLockBehavior m_lockBehavior;
    9192
    92         class DropAllLocks : public Noncopyable {
     93        class DropAllLocks {
     94            WTF_MAKE_NONCOPYABLE(DropAllLocks);
    9395        public:
    9496            DropAllLocks(ExecState* exec);
  • trunk/Source/JavaScriptCore/runtime/JSONObject.cpp

    r74727 r76248  
    7171};
    7272
    73 class Stringifier : public Noncopyable {
     73class Stringifier {
     74    WTF_MAKE_NONCOPYABLE(Stringifier);
    7475public:
    7576    Stringifier(ExecState*, JSValue replacer, JSValue space);
  • trunk/Source/JavaScriptCore/runtime/Lookup.h

    r65104 r76248  
    5454    typedef void (*PutFunction)(ExecState*, JSObject* baseObject, JSValue value);
    5555
    56     class HashEntry : public FastAllocBase {
     56    class HashEntry {
     57        WTF_MAKE_FAST_ALLOCATED;
    5758    public:
    5859        void initialize(StringImpl* key, unsigned char attributes, intptr_t v1, intptr_t v2
  • trunk/Source/JavaScriptCore/runtime/MachineStackMarker.h

    r75342 r76248  
    3535    class MarkStack;
    3636
    37     class MachineStackMarker : public Noncopyable {
     37    class MachineStackMarker {
     38        WTF_MAKE_NONCOPYABLE(MachineStackMarker);
    3839    public:
    3940        MachineStackMarker(Heap*);
  • trunk/Source/JavaScriptCore/runtime/MarkStack.h

    r74431 r76248  
    3838    enum MarkSetProperties { MayContainNullValues, NoNullValues };
    3939   
    40     class MarkStack : Noncopyable {
     40    class MarkStack {
     41        WTF_MAKE_NONCOPYABLE(MarkStack);
    4142    public:
    4243        MarkStack(void* jsArrayVPtr)
  • trunk/Source/JavaScriptCore/runtime/MarkedSpace.h

    r75855 r76248  
    6464    };
    6565
    66     class MarkedSpace : public Noncopyable {
     66    class MarkedSpace {
     67        WTF_MAKE_NONCOPYABLE(MarkedSpace);
    6768    public:
    6869        MarkedSpace(JSGlobalData*);
  • trunk/Source/JavaScriptCore/runtime/RegExpConstructor.h

    r59941 r76248  
    3232    struct RegExpConstructorPrivate;
    3333
    34     struct RegExpConstructorPrivate : FastAllocBase {
     34    struct RegExpConstructorPrivate {
     35        WTF_MAKE_FAST_ALLOCATED;
     36    public:
    3537        // Global search cache / settings
    3638        RegExpConstructorPrivate()
  • trunk/Source/JavaScriptCore/runtime/RegExpObject.h

    r76180 r76248  
    5959        bool match(ExecState*);
    6060
    61         struct RegExpObjectData : FastAllocBase {
     61        struct RegExpObjectData {
     62            WTF_MAKE_FAST_ALLOCATED;
     63        public:
    6264            RegExpObjectData(NonNullPassRefPtr<RegExp> regExp, double lastIndex)
    6365                : regExp(regExp)
     
    6971            double lastIndex;
    7072        };
    71 
     73#if PLATFORM(WIN)
     74        friend void WTF::deleteOwnedPtr<RegExpObjectData>(RegExpObjectData*);
     75#endif
    7276        OwnPtr<RegExpObjectData> d;
    7377    };
  • trunk/Source/JavaScriptCore/runtime/ScopeChain.h

    r48774 r76248  
    2222#define ScopeChain_h
    2323
    24 #include "FastAllocBase.h"
     24#include <wtf/FastAllocBase.h>
    2525
    2626namespace JSC {
     
    3232    class ScopeChainIterator;
    3333   
    34     class ScopeChainNode : public FastAllocBase {
     34    class ScopeChainNode {
     35        WTF_MAKE_FAST_ALLOCATED;
    3536    public:
    3637        ScopeChainNode(ScopeChainNode* next, JSObject* object, JSGlobalData* globalData, JSGlobalObject* globalObject, JSObject* globalThis)
  • trunk/Source/JavaScriptCore/runtime/SmallStrings.cpp

    r65286 r76248  
    4141}
    4242
    43 class SmallStringsStorage : public Noncopyable {
     43class SmallStringsStorage {
     44    WTF_MAKE_NONCOPYABLE(SmallStringsStorage); WTF_MAKE_FAST_ALLOCATED;
    4445public:
    4546    SmallStringsStorage();
  • trunk/Source/JavaScriptCore/runtime/SmallStrings.h

    r65104 r76248  
    3838    class SmallStringsStorage;
    3939
    40     class SmallStrings : public Noncopyable {
     40    class SmallStrings {
     41        WTF_MAKE_NONCOPYABLE(SmallStrings); WTF_MAKE_FAST_ALLOCATED;
    4142    public:
    4243        SmallStrings();
  • trunk/Source/JavaScriptCore/runtime/SymbolTable.h

    r65104 r76248  
    123123
    124124    class SharedSymbolTable : public SymbolTable, public RefCounted<SharedSymbolTable> {
     125        WTF_MAKE_FAST_ALLOCATED;
    125126    public:
    126127        static PassRefPtr<SharedSymbolTable> create() { return adoptRef(new SharedSymbolTable); }
  • trunk/Source/JavaScriptCore/runtime/WeakGCMap.h

    r75443 r76248  
    3636// A HashMap whose get() function returns emptyValue() for cells awaiting destruction.
    3737template<typename KeyType, typename MappedType>
    38 class WeakGCMap : public FastAllocBase {
     38class WeakGCMap {
     39    WTF_MAKE_FAST_ALLOCATED;
    3940    /*
    4041    Invariants:
  • trunk/Source/JavaScriptCore/runtime/WeakGCPtr.h

    r75443 r76248  
    2929#include "Heap.h"
    3030#include "GCHandle.h"
    31 #include <wtf/Noncopyable.h>
    3231
    3332namespace JSC {
    3433
    3534// A smart pointer whose get() function returns 0 for cells awaiting destruction.
    36 template <typename T> class WeakGCPtr : Noncopyable {
     35template <typename T> class WeakGCPtr {
     36    WTF_MAKE_NONCOPYABLE(WeakGCPtr);
    3737public:
    3838    WeakGCPtr()
  • trunk/Source/JavaScriptCore/wtf/CrossThreadRefCounted.h

    r62696 r76248  
    5252    // owned by the original instance and all copies.
    5353    template<class T>
    54     class CrossThreadRefCounted : public Noncopyable {
     54    class CrossThreadRefCounted {
     55        WTF_MAKE_NONCOPYABLE(CrossThreadRefCounted);
    5556    public:
    5657        static PassRefPtr<CrossThreadRefCounted<T> > create(T* data)
  • trunk/Source/JavaScriptCore/wtf/DateMath.h

    r74424 r76248  
    4545
    4646#include <math.h>
     47#include <stdint.h>
    4748#include <string.h>
    4849#include <time.h>
     
    121122// Intentionally overridding the default tm of the system.
    122123// The members of tm differ on various operating systems.
    123 struct GregorianDateTime : Noncopyable {
     124struct GregorianDateTime {
     125    WTF_MAKE_NONCOPYABLE(GregorianDateTime);
     126public:
    124127    GregorianDateTime()
    125128        : second(0)
  • trunk/Source/JavaScriptCore/wtf/Deque.h

    r60683 r76248  
    4545
    4646    template<typename T>
    47     class Deque : public FastAllocBase {
     47    class Deque {
     48        WTF_MAKE_FAST_ALLOCATED;
    4849    public:
    4950        typedef DequeIterator<T> iterator;
  • trunk/Source/JavaScriptCore/wtf/FastAllocBase.h

    r69943 r76248  
    3333//
    3434// Provided functionality:
     35//    Macro: WTF_MAKE_FAST_ALLOCATED
    3536//    namespace WTF {
    36 //        class FastAllocBase;
    3737//
    3838//        T*    fastNew<T>();
     
    4949//
    5050// Example usage:
    51 //    class Widget : public FastAllocBase { ... };
     51//    class Widget {
     52//        WTF_MAKE_FAST_ALLOCATED
     53//    ...
     54//    };
     55//
     56//    struct Data {
     57//        WTF_MAKE_FAST_ALLOCATED
     58//    public:
     59//    ...
     60//    };
    5261//
    5362//    char* charPtr = fastNew<char>();
     
    8392#include "FastMalloc.h"
    8493#include "TypeTraits.h"
    85 
    86 namespace WTF {
    8794
    8895#define WTF_MAKE_FAST_ALLOCATED \
     
    116123         ::WTF::fastFree(p); \
    117124    } \
    118 private:
    119 
    120 class FastAllocBase {
    121     WTF_MAKE_FAST_ALLOCATED 
    122 };
     125private: \
     126typedef int ThisIsHereToForceASemicolonAfterThisMacro
     127
     128namespace WTF {
    123129
    124130    // fastNew / fastDelete
     
    411417} // namespace WTF
    412418
    413 using WTF::FastAllocBase;
    414419using WTF::fastDeleteSkippingDestructor;
    415420
  • trunk/Source/JavaScriptCore/wtf/HashCountedSet.h

    r56435 r76248  
    2323
    2424#include "Assertions.h"
    25 #include "FastAllocBase.h"
    2625#include "HashMap.h"
    2726#include "Vector.h"
     
    3029
    3130    template<typename Value, typename HashFunctions = typename DefaultHash<Value>::Hash,
    32         typename Traits = HashTraits<Value> > class HashCountedSet : public FastAllocBase {
     31        typename Traits = HashTraits<Value> > class HashCountedSet {
     32        WTF_MAKE_FAST_ALLOCATED;
    3333    private:
    3434        typedef HashMap<Value, unsigned, HashFunctions, Traits> ImplType;
  • trunk/Source/JavaScriptCore/wtf/HashMap.h

    r55068 r76248  
    3030    template<typename KeyArg, typename MappedArg, typename HashArg = typename DefaultHash<KeyArg>::Hash,
    3131        typename KeyTraitsArg = HashTraits<KeyArg>, typename MappedTraitsArg = HashTraits<MappedArg> >
    32     class HashMap : public FastAllocBase {
     32    class HashMap {
     33        WTF_MAKE_FAST_ALLOCATED;
    3334    private:
    3435        typedef KeyTraitsArg KeyTraits;
  • trunk/Source/JavaScriptCore/wtf/HashSet.h

    r62138 r76248  
    3636
    3737    template<typename ValueArg, typename HashArg = typename DefaultHash<ValueArg>::Hash,
    38         typename TraitsArg = HashTraits<ValueArg> > class HashSet : public FastAllocBase {
     38        typename TraitsArg = HashTraits<ValueArg> > class HashSet {
     39        WTF_MAKE_FAST_ALLOCATED;
    3940    private:
    4041        typedef HashArg HashFunctions;
  • trunk/Source/JavaScriptCore/wtf/ListHashSet.h

    r65995 r76248  
    5353    template<typename ValueArg, size_t inlineCapacity, typename HashArg> struct ListHashSetNodeHashFunctions;
    5454
    55     template<typename ValueArg, size_t inlineCapacity = 256, typename HashArg = typename DefaultHash<ValueArg>::Hash> class ListHashSet : public FastAllocBase {
     55    template<typename ValueArg, size_t inlineCapacity = 256, typename HashArg = typename DefaultHash<ValueArg>::Hash> class ListHashSet {
     56        WTF_MAKE_FAST_ALLOCATED;
    5657    private:
    5758        typedef ListHashSetNode<ValueArg, inlineCapacity> Node;
  • trunk/Source/JavaScriptCore/wtf/Locker.h

    r45891 r76248  
    3333namespace WTF {
    3434
    35 template <typename T> class Locker : public Noncopyable {
     35template <typename T> class Locker {
     36    WTF_MAKE_NONCOPYABLE(Locker);
    3637public:
    3738    Locker(T& lockable) : m_lockable(lockable) { m_lockable.lock(); }
  • trunk/Source/JavaScriptCore/wtf/MessageQueue.h

    r62551 r76248  
    4949    // Essentially, MessageQueue acts as a queue of OwnPtr<DataType>.
    5050    template<typename DataType>
    51     class MessageQueue : public Noncopyable {
     51    class MessageQueue {
     52        WTF_MAKE_NONCOPYABLE(MessageQueue);
    5253    public:
    5354        MessageQueue() : m_killed(false) { }
  • trunk/Source/JavaScriptCore/wtf/Noncopyable.h

    r69970 r76248  
    4242#endif
    4343
    44 // We don't want argument-dependent lookup to pull in everything from the WTF
    45 // namespace when you use Noncopyable, so put it in its own namespace.
    46 
    47 #include "FastAllocBase.h"
    48 
    49 namespace WTFNoncopyable {
    50 
    51     class Noncopyable : public FastAllocBase {
    52         Noncopyable(const Noncopyable&);
    53         Noncopyable& operator=(const Noncopyable&);
    54     protected:
    55         Noncopyable() { }
    56         ~Noncopyable() { }
    57     };
    58 
    59 } // namespace WTFNoncopyable
    60 
    61 using WTFNoncopyable::Noncopyable;
    62 
    6344#endif // WTF_Noncopyable_h
  • trunk/Source/JavaScriptCore/wtf/OwnArrayPtr.h

    r69970 r76248  
    3636template<typename T> PassOwnArrayPtr<T> adoptArrayPtr(T*);
    3737
    38 template <typename T> class OwnArrayPtr : public Noncopyable {
     38template <typename T> class OwnArrayPtr {
    3939public:
    4040    typedef T* PtrType;
  • trunk/Source/JavaScriptCore/wtf/OwnFastMallocPtr.h

    r55069 r76248  
    2424
    2525#include "FastMalloc.h"
    26 #include "Noncopyable.h"
    2726
    2827namespace WTF {
    2928
    30     template<class T> class OwnFastMallocPtr : public Noncopyable {
     29    template<class T> class OwnFastMallocPtr {
     30        WTF_MAKE_NONCOPYABLE(OwnFastMallocPtr);
    3131    public:
    3232        explicit OwnFastMallocPtr(T* ptr) : m_ptr(ptr)
  • trunk/Source/JavaScriptCore/wtf/OwnPtr.h

    r69970 r76248  
    2323
    2424#include "Assertions.h"
    25 #include "Noncopyable.h"
    2625#include "NullPtr.h"
    2726#include "OwnPtrCommon.h"
     
    4039    template<typename T> PassOwnPtr<T> adoptPtr(T*);
    4140
    42     template<typename T> class OwnPtr : public Noncopyable {
     41    template<typename T> class OwnPtr {
    4342    public:
    4443        typedef typename RemovePointer<T>::Type ValueType;
  • trunk/Source/JavaScriptCore/wtf/RefCounted.h

    r68414 r76248  
    2323
    2424#include "Assertions.h"
     25#include "FastAllocBase.h"
    2526#include "Noncopyable.h"
    2627
     
    132133#endif
    133134
    134 template<typename T> class RefCounted : public RefCountedBase, public Noncopyable {
     135template<typename T> class RefCounted : public RefCountedBase {
     136    WTF_MAKE_NONCOPYABLE(RefCounted); WTF_MAKE_FAST_ALLOCATED;
    135137public:
    136138    void deref()
     
    141143
    142144protected:
     145    RefCounted() { }
    143146    ~RefCounted()
    144147    {
  • trunk/Source/JavaScriptCore/wtf/RefPtr.h

    r74695 r76248  
    3737    enum HashTableDeletedValueType { HashTableDeletedValue };
    3838
    39     template<typename T> class RefPtr : public FastAllocBase {
     39    template<typename T> class RefPtr {
     40        WTF_MAKE_FAST_ALLOCATED;
    4041    public:
    4142        ALWAYS_INLINE RefPtr() : m_ptr(0) { }
  • trunk/Source/JavaScriptCore/wtf/RefPtrHashMap.h

    r75971 r76248  
    4646
    4747    template<typename T, typename MappedArg, typename HashArg, typename KeyTraitsArg, typename MappedTraitsArg>
    48     class HashMap<RefPtr<T>, MappedArg, HashArg, KeyTraitsArg, MappedTraitsArg> : public FastAllocBase {
     48    class HashMap<RefPtr<T>, MappedArg, HashArg, KeyTraitsArg, MappedTraitsArg> {
     49        WTF_MAKE_FAST_ALLOCATED;
    4950    private:
    5051        typedef KeyTraitsArg KeyTraits;
  • trunk/Source/JavaScriptCore/wtf/ThreadIdentifierDataPthreads.h

    r53714 r76248  
    3232#define ThreadIdentifierDataPthreads_h
    3333
    34 #include <wtf/Noncopyable.h>
    3534#include <wtf/Threading.h>
    3635
     
    3938// Holds ThreadIdentifier in the thread-specific storage and employs pthreads-specific 2-pass destruction to reliably remove
    4039// ThreadIdentifier from threadMap. It assumes regular ThreadSpecific types don't use multiple-pass destruction.
    41 class ThreadIdentifierData : public Noncopyable {
     40class ThreadIdentifierData {
     41    WTF_MAKE_NONCOPYABLE(ThreadIdentifierData);
    4242public:
    4343    ~ThreadIdentifierData();
  • trunk/Source/JavaScriptCore/wtf/ThreadSafeShared.h

    r61293 r76248  
    6363
    6464#include <wtf/Atomics.h>
    65 #include <wtf/Noncopyable.h>
    6665#include <wtf/ThreadingPrimitives.h>
    6766
    6867namespace WTF {
    6968
    70 class ThreadSafeSharedBase : public Noncopyable {
     69class ThreadSafeSharedBase {
     70    WTF_MAKE_NONCOPYABLE(ThreadSafeSharedBase); WTF_MAKE_FAST_ALLOCATED;
    7171public:
    7272    ThreadSafeSharedBase(int initialRefCount = 1)
  • trunk/Source/JavaScriptCore/wtf/ThreadSpecific.h

    r66665 r76248  
    6262#endif
    6363
    64 template<typename T> class ThreadSpecific : public Noncopyable {
     64template<typename T> class ThreadSpecific {
     65    WTF_MAKE_NONCOPYABLE(ThreadSpecific);
    6566public:
    6667    ThreadSpecific();
     
    8586
    8687#if USE(PTHREADS) || PLATFORM(QT) || PLATFORM(GTK) || OS(WINDOWS)
    87     struct Data : Noncopyable {
     88    struct Data {
     89        WTF_MAKE_NONCOPYABLE(Data);
     90    public:
    8891        Data(T* value, ThreadSpecific<T>* owner) : value(value), owner(owner) {}
    8992#if PLATFORM(QT)
  • trunk/Source/JavaScriptCore/wtf/ThreadSpecificWin.cpp

    r41594 r76248  
    2222
    2323#include "ThreadSpecific.h"
    24 #include <wtf/Noncopyable.h>
    2524
    2625#if USE(PTHREADS)
  • trunk/Source/JavaScriptCore/wtf/Threading.cpp

    r53714 r76248  
    3131namespace WTF {
    3232
    33 struct NewThreadContext : FastAllocBase {
     33struct NewThreadContext {
     34    WTF_MAKE_FAST_ALLOCATED;
     35public:
    3436    NewThreadContext(ThreadFunction entryPoint, void* data, const char* name)
    3537        : entryPoint(entryPoint)
  • trunk/Source/JavaScriptCore/wtf/ThreadingPrimitives.h

    r66531 r76248  
    3535
    3636#include <wtf/Assertions.h>
     37#include <wtf/FastAllocBase.h>
    3738#include <wtf/Locker.h>
    3839#include <wtf/Noncopyable.h>
     
    9798#endif
    9899   
    99 class Mutex : public Noncopyable {
     100class Mutex {
     101    WTF_MAKE_NONCOPYABLE(Mutex); WTF_MAKE_FAST_ALLOCATED;
    100102public:
    101103    Mutex();
     
    114116typedef Locker<Mutex> MutexLocker;
    115117
    116 class ReadWriteLock : public Noncopyable {
     118class ReadWriteLock {
     119    WTF_MAKE_NONCOPYABLE(ReadWriteLock);
    117120public:
    118121    ReadWriteLock();
     
    131134};
    132135
    133 class ThreadCondition : public Noncopyable {
     136class ThreadCondition {
     137    WTF_MAKE_NONCOPYABLE(ThreadCondition);
    134138public:
    135139    ThreadCondition();
  • trunk/Source/JavaScriptCore/wtf/Vector.h

    r65311 r76248  
    278278
    279279    template<typename T>
    280     class VectorBufferBase : public Noncopyable {
     280    class VectorBufferBase {
     281        WTF_MAKE_NONCOPYABLE(VectorBufferBase);
    281282    public:
    282283        void allocateBuffer(size_t newCapacity)
     
    489490
    490491    template<typename T, size_t inlineCapacity = 0>
    491     class Vector : public FastAllocBase {
     492    class Vector {
     493        WTF_MAKE_FAST_ALLOCATED;
    492494    private:
    493495        typedef VectorBuffer<T, inlineCapacity> Buffer;
  • trunk/Source/JavaScriptCore/wtf/WTFThreadData.h

    r75011 r76248  
    5353typedef HashMap<const char*, RefPtr<StringImpl>, PtrHash<const char*> > LiteralIdentifierTable;
    5454
    55 class IdentifierTable : public FastAllocBase {
     55class IdentifierTable {
     56    WTF_MAKE_FAST_ALLOCATED;
    5657public:
    5758    ~IdentifierTable();
     
    8687typedef void (*AtomicStringTableDestructor)(AtomicStringTable*);
    8788
    88 class WTFThreadData : public Noncopyable {
     89class WTFThreadData {
     90    WTF_MAKE_NONCOPYABLE(WTFThreadData);
    8991public:
    9092    WTFThreadData();
  • trunk/Source/JavaScriptCore/wtf/dtoa.cpp

    r70198 r76248  
    415415}
    416416
    417 struct P5Node : Noncopyable {
     417struct P5Node {
     418    WTF_MAKE_NONCOPYABLE(P5Node); WTF_MAKE_FAST_ALLOCATED;
     419public:
     420    P5Node() { }
    418421    BigInt val;
    419422    P5Node* next;
  • trunk/Source/JavaScriptCore/wtf/gobject/GOwnPtr.h

    r68516 r76248  
    4242template<> void freeOwnedGPtr<GFile>(GFile*);
    4343
    44 template <typename T> class GOwnPtr : public Noncopyable {
     44template <typename T> class GOwnPtr {
     45    WTF_MAKE_NONCOPYABLE(GOwnPtr);
    4546public:
    4647    explicit GOwnPtr(T* ptr = 0) : m_ptr(ptr) { }
  • trunk/Source/JavaScriptCore/wtf/text/StringBuffer.h

    r68812 r76248  
    3131
    3232#include <wtf/Assertions.h>
    33 #include <wtf/Noncopyable.h>
    3433#include <wtf/unicode/Unicode.h>
    3534#include <limits>
     
    3736namespace WTF {
    3837
    39 class StringBuffer : public Noncopyable {
     38class StringBuffer {
     39    WTF_MAKE_NONCOPYABLE(StringBuffer);
    4040public:
    4141    explicit StringBuffer(unsigned length)
  • trunk/Source/JavaScriptCore/wtf/text/StringImplBase.h

    r58851 r76248  
    2727#define StringImplBase_h
    2828
    29 #include <wtf/Noncopyable.h>
    3029#include <wtf/unicode/Unicode.h>
    3130
    3231namespace WTF {
    3332
    34 class StringImplBase : public Noncopyable {
     33class StringImplBase {
     34    WTF_MAKE_NONCOPYABLE(StringImplBase); WTF_MAKE_FAST_ALLOCATED;
    3535public:
    3636    bool isStringImpl() { return (m_refCountAndFlags & s_refCountInvalidForStringImpl) != s_refCountInvalidForStringImpl; }
     
    4545        BufferShared,
    4646    };
    47 
    48     using Noncopyable::operator new;
    49     void* operator new(size_t, void* inPlace) { ASSERT(inPlace); return inPlace; }
    5047
    5148    // For SmallStringStorage, which allocates an array and uses an in-place new.
  • trunk/Source/JavaScriptCore/wtf/unicode/Collator.h

    r55120 r76248  
    3030#define WTF_Collator_h
    3131
     32#include <wtf/FastAllocBase.h>
    3233#include <wtf/Noncopyable.h>
    3334#include <wtf/PassOwnPtr.h>
     
    4041namespace WTF {
    4142
    42     class Collator : public Noncopyable {
     43    class Collator {
     44        WTF_MAKE_NONCOPYABLE(Collator); WTF_MAKE_FAST_ALLOCATED;
    4345    public:
    4446        enum Result { Equal = 0, Greater = 1, Less = -1 };
  • trunk/Source/JavaScriptCore/yarr/YarrInterpreter.h

    r75602 r76248  
    300300};
    301301
    302 class ByteDisjunction : public FastAllocBase {
     302class ByteDisjunction {
     303    WTF_MAKE_FAST_ALLOCATED;
    303304public:
    304305    ByteDisjunction(unsigned numSubpatterns, unsigned frameSize)
     
    313314};
    314315
    315 struct BytecodePattern : FastAllocBase {
     316struct BytecodePattern {
     317    WTF_MAKE_FAST_ALLOCATED;
     318public:
    316319    BytecodePattern(PassOwnPtr<ByteDisjunction> body, Vector<ByteDisjunction*> allParenthesesInfo, YarrPattern& pattern, BumpPointerAllocator* allocator)
    317320        : m_body(body)
  • trunk/Source/JavaScriptCore/yarr/YarrPattern.h

    r75602 r76248  
    6464};
    6565
    66 struct CharacterClass : FastAllocBase {
     66struct CharacterClass {
     67    WTF_MAKE_FAST_ALLOCATED;
     68public:
    6769    // All CharacterClass instances have to have the full set of matches and ranges,
    6870    // they may have an optional table for faster lookups (which must match the
     
    205207};
    206208
    207 struct PatternAlternative : FastAllocBase {
     209struct PatternAlternative {
     210    WTF_MAKE_FAST_ALLOCATED;
     211public:
    208212    PatternAlternative(PatternDisjunction* disjunction)
    209213        : m_parent(disjunction)
     
    246250};
    247251
    248 struct PatternDisjunction : FastAllocBase {
     252struct PatternDisjunction {
     253    WTF_MAKE_FAST_ALLOCATED;
     254public:
    249255    PatternDisjunction(PatternAlternative* parent = 0)
    250256        : m_parent(parent)
Note: See TracChangeset for help on using the changeset viewer.