diff options
Diffstat (limited to 'Source/JavaScriptCore/runtime/JSGlobalData.h')
-rw-r--r-- | Source/JavaScriptCore/runtime/JSGlobalData.h | 63 |
1 files changed, 42 insertions, 21 deletions
diff --git a/Source/JavaScriptCore/runtime/JSGlobalData.h b/Source/JavaScriptCore/runtime/JSGlobalData.h index 7b69055..f1085af 100644 --- a/Source/JavaScriptCore/runtime/JSGlobalData.h +++ b/Source/JavaScriptCore/runtime/JSGlobalData.h @@ -33,13 +33,13 @@ #include "Heap.h" #include "DateInstanceCache.h" #include "ExecutableAllocator.h" +#include "Strong.h" #include "JITStubs.h" #include "JSValue.h" #include "NumericStrings.h" #include "SmallStrings.h" #include "Terminator.h" #include "TimeoutChecker.h" -#include "WeakGCMap.h" #include "WeakRandom.h" #include <wtf/BumpPointerAllocator.h> #include <wtf/Forward.h> @@ -58,11 +58,13 @@ namespace JSC { class CodeBlock; class CommonIdentifiers; + class HandleStack; class IdentifierTable; class Interpreter; class JSGlobalObject; class JSObject; class Lexer; + class NativeExecutable; class Parser; class RegExpCache; class Stringifier; @@ -75,8 +77,6 @@ namespace JSC { struct HashTable; struct Instruction; - typedef WeakGCMap<JSGlobalObject*, JSGlobalObject> GlobalObjectMap; // FIXME: Would be nice to use a WeakGCSet here. - struct DSTOffsetCache { DSTOffsetCache() { @@ -130,7 +130,7 @@ namespace JSC { #if ENABLE(JSC_MULTIPLE_THREADS) // Will start tracking threads that use the heap, which is resource-heavy. - void makeUsableFromMultipleThreads() { heap.machineStackMarker().makeUsableFromMultipleThreads(); } + void makeUsableFromMultipleThreads() { heap.machineThreads().makeUsableFromMultipleThreads(); } #endif GlobalDataType globalDataType; @@ -141,21 +141,34 @@ namespace JSC { const HashTable* jsonTable; const HashTable* mathTable; const HashTable* numberTable; + const HashTable* objectConstructorTable; const HashTable* regExpTable; const HashTable* regExpConstructorTable; const HashTable* stringTable; - RefPtr<Structure> activationStructure; - RefPtr<Structure> interruptedExecutionErrorStructure; - RefPtr<Structure> terminatedExecutionErrorStructure; - RefPtr<Structure> staticScopeStructure; - RefPtr<Structure> strictEvalActivationStructure; - RefPtr<Structure> stringStructure; - RefPtr<Structure> notAnObjectStructure; - RefPtr<Structure> propertyNameIteratorStructure; - RefPtr<Structure> getterSetterStructure; - RefPtr<Structure> apiWrapperStructure; - RefPtr<Structure> dummyMarkableCellStructure; + Strong<Structure> structureStructure; + Strong<Structure> activationStructure; + Strong<Structure> interruptedExecutionErrorStructure; + Strong<Structure> terminatedExecutionErrorStructure; + Strong<Structure> staticScopeStructure; + Strong<Structure> strictEvalActivationStructure; + Strong<Structure> stringStructure; + Strong<Structure> notAnObjectStructure; + Strong<Structure> propertyNameIteratorStructure; + Strong<Structure> getterSetterStructure; + Strong<Structure> apiWrapperStructure; + Strong<Structure> scopeChainNodeStructure; + Strong<Structure> executableStructure; + Strong<Structure> nativeExecutableStructure; + Strong<Structure> evalExecutableStructure; + Strong<Structure> programExecutableStructure; + Strong<Structure> functionExecutableStructure; + Strong<Structure> dummyMarkableCellStructure; + Strong<Structure> structureChainStructure; + +#if ENABLE(JSC_ZOMBIES) + Strong<Structure> zombieStructure; +#endif static void storeVPtrs(); static JS_EXPORTDATA void* jsArrayVPtr; @@ -199,27 +212,26 @@ namespace JSC { { return jitStubs->ctiStub(this, generator); } - PassRefPtr<NativeExecutable> getHostFunction(NativeFunction function); - PassRefPtr<NativeExecutable> getHostFunction(NativeFunction function, ThunkGenerator generator); + NativeExecutable* getHostFunction(NativeFunction, ThunkGenerator); #endif + NativeExecutable* getHostFunction(NativeFunction); + TimeoutChecker timeoutChecker; Terminator terminator; Heap heap; - DeprecatedPtr<Unknown> exception; + JSValue exception; #if ENABLE(JIT) ReturnAddressPtr exceptionLocation; #endif HashMap<OpaqueJSClass*, OpaqueJSClassContextData*> opaqueJSClassData; - GlobalObjectMap globalObjects; + unsigned globalObjectCount; JSGlobalObject* dynamicGlobalObject; HashSet<JSObject*> stringRecursionCheckVisitedObjects; - Stringifier* firstStringifierToMark; - double cachedUTCOffset; DSTOffsetCache dstOffsetCache; @@ -253,6 +265,10 @@ namespace JSC { void addRegExpToTrace(PassRefPtr<RegExp> regExp); #endif void dumpRegExpTrace(); + HandleSlot allocateGlobalHandle() { return heap.allocateGlobalHandle(); } + HandleSlot allocateLocalHandle() { return heap.allocateLocalHandle(); } + void clearBuiltinStructures(); + private: JSGlobalData(GlobalDataType, ThreadStackType); static JSGlobalData*& sharedInstanceInternal(); @@ -263,6 +279,11 @@ namespace JSC { StackBounds m_stack; }; + inline HandleSlot allocateGlobalHandle(JSGlobalData& globalData) + { + return globalData.allocateGlobalHandle(); + } + } // namespace JSC #endif // JSGlobalData_h |