Ignore:
Timestamp:
Feb 23, 2009, 7:58:09 PM (16 years ago)
Author:
[email protected]
Message:

2009-02-23 Geoffrey Garen <[email protected]>

Reviewed by Sam Weinig.

Next step in splitting JIT functionality out of the Interpreter class:
Moved vptr storage from Interpreter to JSGlobalData, so it could be shared
between Interpreter and JITStubs, and moved the *Trampoline JIT stubs
into the JITStubs class. Also added a VPtrSet class to encapsulate vptr
hacks during JSGlobalData initialization.


SunSpider says 0.4% faster. Meh.

  • JavaScriptCore.exp:
  • JavaScriptCore.xcodeproj/project.pbxproj:
  • interpreter/Interpreter.cpp: (JSC::Interpreter::Interpreter): (JSC::Interpreter::tryCacheGetByID): (JSC::Interpreter::privateExecute):
  • interpreter/Interpreter.h:
  • jit/JIT.cpp: (JSC::JIT::privateCompileMainPass): (JSC::JIT::privateCompile): (JSC::JIT::privateCompileCTIMachineTrampolines):
  • jit/JIT.h: (JSC::JIT::compileCTIMachineTrampolines):
  • jit/JITCall.cpp: (JSC::JIT::compileOpCall): (JSC::JIT::compileOpCallSlowCase):
  • jit/JITPropertyAccess.cpp: (JSC::JIT::privateCompilePatchGetArrayLength):
  • jit/JITStubs.cpp: (JSC::JITStubs::JITStubs): (JSC::JITStubs::tryCacheGetByID): (JSC::JITStubs::cti_vm_dontLazyLinkCall): (JSC::JITStubs::cti_op_get_by_val): (JSC::JITStubs::cti_op_get_by_val_byte_array): (JSC::JITStubs::cti_op_put_by_val): (JSC::JITStubs::cti_op_put_by_val_array): (JSC::JITStubs::cti_op_put_by_val_byte_array): (JSC::JITStubs::cti_op_is_string):
  • jit/JITStubs.h: (JSC::JITStubs::ctiArrayLengthTrampoline): (JSC::JITStubs::ctiStringLengthTrampoline): (JSC::JITStubs::ctiVirtualCallPreLink): (JSC::JITStubs::ctiVirtualCallLink): (JSC::JITStubs::ctiVirtualCall):
  • runtime/ArrayPrototype.cpp: (JSC::arrayProtoFuncPop): (JSC::arrayProtoFuncPush):
  • runtime/FunctionPrototype.cpp: (JSC::functionProtoFuncApply):
  • runtime/JSArray.h: (JSC::isJSArray):
  • runtime/JSByteArray.h: (JSC::asByteArray): (JSC::isJSByteArray):
  • runtime/JSCell.h:
  • runtime/JSFunction.h:
  • runtime/JSGlobalData.cpp: (JSC::VPtrSet::VPtrSet): (JSC::JSGlobalData::JSGlobalData): (JSC::JSGlobalData::create): (JSC::JSGlobalData::sharedInstance):
  • runtime/JSGlobalData.h:
  • runtime/JSString.h: (JSC::isJSString):
  • runtime/Operations.h: (JSC::jsLess): (JSC::jsLessEq):
  • wrec/WREC.cpp: (JSC::WREC::Generator::compileRegExp):
File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/JavaScriptCore/runtime/JSGlobalData.h

    r41126 r41168  
    3232#include "Collector.h"
    3333#include "ExecutableAllocator.h"
     34#include "JITStubs.h"
    3435#include "JSValue.h"
    3536#include "SmallStrings.h"
     
    5960    class UString;
    6061    struct HashTable;
     62    struct VPtrSet;
    6163
    6264    class JSGlobalData : public RefCounted<JSGlobalData> {
     
    6971        static JSGlobalData& sharedInstance();
    7072
    71         static PassRefPtr<JSGlobalData> create();
     73        static PassRefPtr<JSGlobalData> create(bool isShared = false);
    7274        static PassRefPtr<JSGlobalData> createLeaked();
    7375        ~JSGlobalData();
     
    8082        bool isSharedInstance;
    8183        ClientData* clientData;
    82 
    83         Interpreter* interpreter;
    84         TimeoutChecker timeoutChecker;
    85 
    86         JSValuePtr exception;
    87 #if ENABLE(JIT)
    88         void* exceptionLocation;
    89 #endif
    90 
    91         const Vector<Instruction>& numericCompareFunction(ExecState*);
    92         Vector<Instruction> lazyNumericCompareFunction;
    93         bool initializingLazyNumericCompareFunction;
    9484
    9585        const HashTable* arrayTable;
     
    111101#endif
    112102
     103        void* jsArrayVPtr;
     104        void* jsByteArrayVPtr;
     105        void* jsStringVPtr;
     106        void* jsFunctionVPtr;
     107
    113108        IdentifierTable* identifierTable;
    114109        CommonIdentifiers* propertyNames;
    115110        const ArgList* emptyList; // Lists are supposed to be allocated on the stack to have their elements properly marked, which is not the case here - but this list has nothing to mark.
    116111        SmallStrings smallStrings;
    117        
    118         HashMap<OpaqueJSClass*, OpaqueJSClassContextData*> opaqueJSClassData;
     112
     113#if ENABLE(ASSEMBLER)
     114        ExecutableAllocator executableAllocator;
     115#endif
    119116
    120117        Lexer* lexer;
    121118        Parser* parser;
     119        Interpreter* interpreter;
     120#if ENABLE(JIT)
     121        JITStubs jitStubs;
     122#endif
     123        TimeoutChecker timeoutChecker;
     124        Heap heap;
     125
     126        JSValuePtr exception;
     127#if ENABLE(JIT)
     128        void* exceptionLocation;
     129#endif
     130
     131        const Vector<Instruction>& numericCompareFunction(ExecState*);
     132        Vector<Instruction> lazyNumericCompareFunction;
     133        bool initializingLazyNumericCompareFunction;
     134
     135        HashMap<OpaqueJSClass*, OpaqueJSClassContextData*> opaqueJSClassData;
     136
    122137        HashSet<ParserRefCounted*>* newParserObjects;
    123138        HashCountedSet<ParserRefCounted*>* parserObjectExtraRefCounts;
     
    130145        ScopeNode* scopeNodeBeingReparsed;
    131146
    132         Heap heap;
    133 #if ENABLE(ASSEMBLER)
    134         PassRefPtr<ExecutablePool> poolForSize(size_t n) { return m_executableAllocator.poolForSize(n); }
    135 #endif
    136 
    137147    private:
    138         JSGlobalData(bool isShared = false);
    139 #if ENABLE(ASSEMBLER)
    140         ExecutableAllocator m_executableAllocator;
    141 #endif
    142 
     148        JSGlobalData(bool isShared, const VPtrSet&);
    143149        static JSGlobalData*& sharedInstanceInternal();
    144150    };
Note: See TracChangeset for help on using the changeset viewer.