X-Git-Url: https://git.saurik.com/apple/javascriptcore.git/blobdiff_plain/9bcd318d5fa2a38139c9651d263a06c797529333..ba379fdc102753d6be2c4d937058fe40257329fe:/runtime/JSGlobalData.h diff --git a/runtime/JSGlobalData.h b/runtime/JSGlobalData.h index 4223191..5e487f9 100644 --- a/runtime/JSGlobalData.h +++ b/runtime/JSGlobalData.h @@ -1,5 +1,5 @@ /* - * Copyright (C) 2008 Apple Inc. All rights reserved. + * Copyright (C) 2008, 2009 Apple Inc. All rights reserved. * * Redistribution and use in source and binary forms, with or without * modification, are permitted provided that the following conditions @@ -29,22 +29,23 @@ #ifndef JSGlobalData_h #define JSGlobalData_h -#include -#include -#include #include "Collector.h" #include "ExecutableAllocator.h" -#include "SmallStrings.h" +#include "JITStubs.h" #include "JSValue.h" +#include "SmallStrings.h" +#include "TimeoutChecker.h" +#include +#include +#include struct OpaqueJSClass; struct OpaqueJSClassContextData; namespace JSC { - class ArgList; class CommonIdentifiers; - class Heap; + class FunctionBodyNode; class IdentifierTable; class Instruction; class Interpreter; @@ -52,18 +53,24 @@ namespace JSC { class JSObject; class Lexer; class Parser; - class ParserRefCounted; class ScopeNode; + class Stringifier; class Structure; class UString; + struct HashTable; + struct VPtrSet; class JSGlobalData : public RefCounted { public: + struct ClientData { + virtual ~ClientData() = 0; + }; + static bool sharedInstanceExists(); static JSGlobalData& sharedInstance(); - static PassRefPtr create(); + static PassRefPtr create(bool isShared = false); static PassRefPtr createLeaked(); ~JSGlobalData(); @@ -72,19 +79,12 @@ namespace JSC { void makeUsableFromMultipleThreads() { heap.makeUsableFromMultipleThreads(); } #endif - const Vector& numericCompareFunction(ExecState*); - Vector lazyNumericCompareFunction; - bool initializingLazyNumericCompareFunction; - - Interpreter* interpreter; - - JSValuePtr exception; -#if ENABLE(JIT) - void* exceptionLocation; -#endif + bool isSharedInstance; + ClientData* clientData; const HashTable* arrayTable; const HashTable* dateTable; + const HashTable* jsonTable; const HashTable* mathTable; const HashTable* numberTable; const HashTable* regExpTable; @@ -97,52 +97,58 @@ namespace JSC { RefPtr stringStructure; RefPtr notAnObjectErrorStubStructure; RefPtr notAnObjectStructure; -#if !USE(ALTERNATE_JSIMMEDIATE) +#if USE(JSVALUE32) RefPtr numberStructure; #endif + void* jsArrayVPtr; + void* jsByteArrayVPtr; + void* jsStringVPtr; + void* jsFunctionVPtr; + IdentifierTable* identifierTable; CommonIdentifiers* propertyNames; - 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. - + const MarkedArgumentBuffer* 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. SmallStrings smallStrings; - - HashMap opaqueJSClassData; - HashSet* newParserObjects; - HashCountedSet* parserObjectExtraRefCounts; +#if ENABLE(ASSEMBLER) + ExecutableAllocator executableAllocator; +#endif Lexer* lexer; Parser* parser; + Interpreter* interpreter; +#if ENABLE(JIT) + JITThunks jitStubs; +#endif + TimeoutChecker timeoutChecker; + Heap heap; - JSGlobalObject* head; - JSGlobalObject* dynamicGlobalObject; + JSValue exception; +#if ENABLE(JIT) + ReturnAddressPtr exceptionLocation; +#endif - bool isSharedInstance; + const Vector& numericCompareFunction(ExecState*); + Vector lazyNumericCompareFunction; + bool initializingLazyNumericCompareFunction; - struct ClientData { - virtual ~ClientData() = 0; - }; + HashMap opaqueJSClassData; - ClientData* clientData; + JSGlobalObject* head; + JSGlobalObject* dynamicGlobalObject; HashSet arrayVisitedElements; ScopeNode* scopeNodeBeingReparsed; + Stringifier* firstStringifierToMark; - Heap heap; -#if ENABLE(ASSEMBLER) - PassRefPtr poolForSize(size_t n) { return m_executableAllocator.poolForSize(n); } -#endif private: - JSGlobalData(bool isShared = false); -#if ENABLE(ASSEMBLER) - ExecutableAllocator m_executableAllocator; -#endif - + JSGlobalData(bool isShared, const VPtrSet&); static JSGlobalData*& sharedInstanceInternal(); + void createNativeThunk(); }; -} +} // namespace JSC -#endif +#endif // JSGlobalData_h