summaryrefslogtreecommitdiffstats
path: root/JavaScriptCore/runtime/JSGlobalData.cpp
diff options
context:
space:
mode:
authorBen Murdoch <benm@google.com>2010-05-11 18:35:50 +0100
committerBen Murdoch <benm@google.com>2010-05-14 10:23:05 +0100
commit21939df44de1705786c545cd1bf519d47250322d (patch)
treeef56c310f5c0cdc379c2abb2e212308a3281ce20 /JavaScriptCore/runtime/JSGlobalData.cpp
parent4ff1d8891d520763f17675827154340c7c740f90 (diff)
downloadexternal_webkit-21939df44de1705786c545cd1bf519d47250322d.zip
external_webkit-21939df44de1705786c545cd1bf519d47250322d.tar.gz
external_webkit-21939df44de1705786c545cd1bf519d47250322d.tar.bz2
Merge Webkit at r58956: Initial merge by Git.
Change-Id: I1d9fb60ea2c3f2ddc04c17a871acdb39353be228
Diffstat (limited to 'JavaScriptCore/runtime/JSGlobalData.cpp')
-rw-r--r--JavaScriptCore/runtime/JSGlobalData.cpp19
1 files changed, 9 insertions, 10 deletions
diff --git a/JavaScriptCore/runtime/JSGlobalData.cpp b/JavaScriptCore/runtime/JSGlobalData.cpp
index 2948d1c..12fa2be 100644
--- a/JavaScriptCore/runtime/JSGlobalData.cpp
+++ b/JavaScriptCore/runtime/JSGlobalData.cpp
@@ -103,8 +103,8 @@ void JSGlobalData::storeVPtrs()
jsFunction->~JSCell();
}
-JSGlobalData::JSGlobalData(bool isShared, ThreadStackType threadStackType)
- : isSharedInstance(isShared)
+JSGlobalData::JSGlobalData(GlobalDataType globalDataType, ThreadStackType threadStackType)
+ : globalDataType(globalDataType)
, clientData(0)
, arrayTable(fastNew<HashTable>(JSC::arrayTable))
, dateTable(fastNew<HashTable>(JSC::dateTable))
@@ -128,7 +128,7 @@ JSGlobalData::JSGlobalData(bool isShared, ThreadStackType threadStackType)
#if USE(JSVALUE32)
, numberStructure(JSNumberCell::createStructure(jsNull()))
#endif
- , identifierTable(createIdentifierTable())
+ , identifierTable(globalDataType == Default ? wtfThreadData().currentIdentifierTable() : createIdentifierTable())
, propertyNames(new CommonIdentifiers(this))
, emptyList(new MarkedArgumentBuffer)
, lexer(new Lexer(this))
@@ -192,21 +192,20 @@ JSGlobalData::~JSGlobalData()
delete emptyList;
delete propertyNames;
- deleteIdentifierTable(identifierTable);
+ if (globalDataType != Default)
+ deleteIdentifierTable(identifierTable);
delete clientData;
}
-PassRefPtr<JSGlobalData> JSGlobalData::createNonDefault(ThreadStackType type)
+PassRefPtr<JSGlobalData> JSGlobalData::createContextGroup(ThreadStackType type)
{
- return adoptRef(new JSGlobalData(false, type));
+ return adoptRef(new JSGlobalData(APIContextGroup, type));
}
PassRefPtr<JSGlobalData> JSGlobalData::create(ThreadStackType type)
{
- JSGlobalData* globalData = new JSGlobalData(false, type);
- wtfThreadData().initializeIdentifierTable(globalData->identifierTable);
- return adoptRef(globalData);
+ return adoptRef(new JSGlobalData(Default, type));
}
PassRefPtr<JSGlobalData> JSGlobalData::createLeaked(ThreadStackType type)
@@ -226,7 +225,7 @@ JSGlobalData& JSGlobalData::sharedInstance()
{
JSGlobalData*& instance = sharedInstanceInternal();
if (!instance) {
- instance = new JSGlobalData(true, ThreadStackTypeSmall);
+ instance = new JSGlobalData(APIShared, ThreadStackTypeSmall);
#if ENABLE(JSC_MULTIPLE_THREADS)
instance->makeUsableFromMultipleThreads();
#endif