Commit ab71e979 authored by ggaren@apple.com's avatar ggaren@apple.com

Made WeakSet::allocate() static and removed its JSGlobalData argument

https://bugs.webkit.org/show_bug.cgi?id=85128

Reviewed by Anders Carlsson.

../JavaScriptCore: 

This is a step toward faster finalization.

WeakSet::allocate() now deduces which WeakSet to allocate from based on
its JSCell* argument. (Currently, there's only one WeakSet, but soon
there will be many.)

This was a global replace of "globalData.heap.weakSet()->allocate" with
"WeakSet::allocate", plus by-hand removal of the JSGlobalData argument.

* heap/WeakSetInlines.h: Copied from Source/JavaScriptCore/heap/WeakSet.h.

I had to split out WeakSet::allocate() in to a separate header to avoid
a cycle.

(JSC::WeakSet::allocate): We can mask the pointer we're passed to
figure out where to allocate our WeakImpl. (Soon, we'll use this to
associate the WeakImpl with the GC block it references.)

../WebCore: 

Mechanically removed JSGlobalData arguments from PassWeak<T> and Weak<T> allocation.

* bindings/js/JSDOMBinding.cpp:
(WebCore::jsStringSlowCase):
* bindings/js/JSEventListener.h:
(WebCore::JSEventListener::setWrapper):
* bindings/js/JSNodeFilterCondition.cpp:
(WebCore::JSNodeFilterCondition::JSNodeFilterCondition):
* bindings/js/ScriptWrappable.h:
(WebCore::ScriptWrappable::setWrapper):
* bridge/jsc/BridgeJSC.cpp:
(JSC::Bindings::Instance::createRuntimeObject):
* bridge/qt/qt_runtime.cpp:
(JSC::Bindings::QtRuntimeMethod::finishCreation):
* bridge/runtime_root.cpp:
(JSC::Bindings::RootObject::addRuntimeObject):

../WebKit2: 

Mechanically removed JSGlobalData arguments from PassWeak<T> and Weak<T> allocation.

* WebProcess/Plugins/Netscape/NPRuntimeObjectMap.cpp:
(WebKit::NPRuntimeObjectMap::getOrCreateJSObject):


git-svn-id: http://svn.webkit.org/repository/webkit/trunk@115545 268f45cc-cd09-0410-ab3c-d52691b4dbfc
parent b7e2c5a7
......@@ -104,7 +104,7 @@ void JSCallbackObject<Parent>::init(ExecState* exec)
for (JSClassRef jsClassPtr = classRef(); jsClassPtr; jsClassPtr = jsClassPtr->parentClass) {
if (jsClassPtr->finalize) {
exec->globalData().heap.weakSet()->allocate(this, m_callbackObjectData.get(), classRef());
WeakSet::allocate(this, m_callbackObjectData.get(), classRef());
break;
}
}
......
......@@ -211,7 +211,7 @@ JSObject* OpaqueJSClass::prototype(ExecState* exec)
if (!jsClassData.cachedPrototype) {
// Recursive, but should be good enough for our purposes
jsClassData.cachedPrototype = PassWeak<JSObject>(exec->globalData(), JSCallbackObject<JSNonFinalObject>::create(exec, exec->lexicalGlobalObject(), exec->lexicalGlobalObject()->callbackObjectStructure(), prototypeClass, &jsClassData), 0); // set jsClassData as the object's private data, so it can clear our reference on destruction
jsClassData.cachedPrototype = PassWeak<JSObject>(JSCallbackObject<JSNonFinalObject>::create(exec, exec->lexicalGlobalObject(), exec->lexicalGlobalObject()->callbackObjectStructure(), prototypeClass, &jsClassData), 0); // set jsClassData as the object's private data, so it can clear our reference on destruction
if (parentClass) {
if (JSObject* prototype = parentClass->prototype(exec))
jsClassData.cachedPrototype->setPrototype(exec->globalData(), prototype);
......
2012-04-27 Geoffrey Garen <ggaren@apple.com>
Made WeakSet::allocate() static and removed its JSGlobalData argument
https://bugs.webkit.org/show_bug.cgi?id=85128
Reviewed by Anders Carlsson.
This is a step toward faster finalization.
WeakSet::allocate() now deduces which WeakSet to allocate from based on
its JSCell* argument. (Currently, there's only one WeakSet, but soon
there will be many.)
This was a global replace of "globalData.heap.weakSet()->allocate" with
"WeakSet::allocate", plus by-hand removal of the JSGlobalData argument.
* heap/WeakSetInlines.h: Copied from Source/JavaScriptCore/heap/WeakSet.h.
I had to split out WeakSet::allocate() in to a separate header to avoid
a cycle.
(JSC::WeakSet::allocate): We can mask the pointer we're passed to
figure out where to allocate our WeakImpl. (Soon, we'll use this to
associate the WeakImpl with the GC block it references.)
2012-04-27 Geoffrey Garen <ggaren@apple.com>
Stop using aligned allocation for WeakBlock
......@@ -258,6 +258,7 @@ javascriptcore_sources += \
Source/JavaScriptCore/heap/WeakImpl.h \
Source/JavaScriptCore/heap/WeakSet.cpp \
Source/JavaScriptCore/heap/WeakSet.h \
Source/JavaScriptCore/heap/WeakSetInlines.h \
Source/JavaScriptCore/heap/WeakReferenceHarvester.h \
Source/JavaScriptCore/heap/WriteBarrierSupport.cpp \
Source/JavaScriptCore/heap/WriteBarrierSupport.h \
......
......@@ -156,6 +156,7 @@
'heap/WeakImpl.h',
'heap/WeakReferenceHarvester.h',
'heap/WeakSet.h',
'heap/WeakSetInlines.h',
'heap/WriteBarrierSupport.h',
'debugger/Debugger.h',
'debugger/DebuggerActivation.h',
......
......@@ -2145,6 +2145,10 @@
RelativePath="..\..\heap\WeakSet.h"
>
</File>
<File
RelativePath="..\..\heap\WeakSetInlines.h"
>
</File>
<File
RelativePath="..\..\heap\WeakImpl.h"
>
......
......@@ -195,6 +195,7 @@
141211340A48795800480255 /* minidom.c in Sources */ = {isa = PBXBuildFile; fileRef = 141211020A48780900480255 /* minidom.c */; };
141448CB13A176EC00F5BA1A /* MarkedBlockSet.h in Headers */ = {isa = PBXBuildFile; fileRef = 141448CA13A176EC00F5BA1A /* MarkedBlockSet.h */; settings = {ATTRIBUTES = (Private, ); }; };
141448CD13A1783700F5BA1A /* TinyBloomFilter.h in Headers */ = {isa = PBXBuildFile; fileRef = 141448CC13A1783700F5BA1A /* TinyBloomFilter.h */; settings = {ATTRIBUTES = (Private, ); }; };
14150133154BB13F005D8C98 /* WeakSetInlines.h in Headers */ = {isa = PBXBuildFile; fileRef = 14150132154BB13F005D8C98 /* WeakSetInlines.h */; settings = {ATTRIBUTES = (Private, ); }; };
1420BE7B10AA6DDB00F455D2 /* WeakRandom.h in Headers */ = {isa = PBXBuildFile; fileRef = 1420BE7A10AA6DDB00F455D2 /* WeakRandom.h */; settings = {ATTRIBUTES = (Private, ); }; };
1421359B0A677F4F00A8195E /* JSBase.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 1421359A0A677F4F00A8195E /* JSBase.cpp */; };
14280823107EC02C0013E7B2 /* Debugger.cpp in Sources */ = {isa = PBXBuildFile; fileRef = F692A8580255597D01FF60F7 /* Debugger.cpp */; };
......@@ -862,6 +863,7 @@
141211200A48793C00480255 /* minidom */ = {isa = PBXFileReference; explicitFileType = "compiled.mach-o.executable"; includeInIndex = 0; path = minidom; sourceTree = BUILT_PRODUCTS_DIR; };
141448CA13A176EC00F5BA1A /* MarkedBlockSet.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = MarkedBlockSet.h; sourceTree = "<group>"; };
141448CC13A1783700F5BA1A /* TinyBloomFilter.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = TinyBloomFilter.h; sourceTree = "<group>"; };
14150132154BB13F005D8C98 /* WeakSetInlines.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = WeakSetInlines.h; sourceTree = "<group>"; };
1420BE7A10AA6DDB00F455D2 /* WeakRandom.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = WeakRandom.h; sourceTree = "<group>"; };
1421359A0A677F4F00A8195E /* JSBase.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = JSBase.cpp; sourceTree = "<group>"; };
142711380A460BBB0080EEEA /* JSBase.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = JSBase.h; sourceTree = "<group>"; };
......@@ -1558,14 +1560,14 @@
142E312A134FF0A600AFADB5 /* heap */ = {
isa = PBXGroup;
children = (
A7521E121429169A003C8D0C /* CardSet.h */,
146B14DB12EB5B12001BEC1B /* ConservativeRoots.cpp */,
149DAAF212EB559D0083B12B /* ConservativeRoots.h */,
C2EAD2FB14F0249800A4B159 /* CopiedAllocator.h */,
C2C8D02E14A3CEFC00578E65 /* CopiedBlock.h */,
C240305314B404C90079EB64 /* CopiedSpace.cpp */,
C2EAA3F8149A830800FCE112 /* CopiedSpace.h */,
C2C8D02B14A3C6B200578E65 /* CopiedSpaceInlineMethods.h */,
A7521E121429169A003C8D0C /* CardSet.h */,
146B14DB12EB5B12001BEC1B /* ConservativeRoots.cpp */,
149DAAF212EB559D0083B12B /* ConservativeRoots.h */,
0F2C556D14738F2E00121E4F /* DFGCodeBlocks.cpp */,
0F2C556E14738F2E00121E4F /* DFGCodeBlocks.h */,
BCBE2CAD14E985AA000593AD /* GCAssertions.h */,
......@@ -1606,10 +1608,11 @@
14E84F9A14EE1ACC00D6D5D4 /* WeakBlock.h */,
14F7256314EE265E00B1652B /* WeakHandleOwner.cpp */,
14F7256414EE265E00B1652B /* WeakHandleOwner.h */,
14E84F9B14EE1ACC00D6D5D4 /* WeakSet.cpp */,
14E84F9C14EE1ACC00D6D5D4 /* WeakSet.h */,
14E84F9D14EE1ACC00D6D5D4 /* WeakImpl.h */,
0F242DA513F3B1BB007ADD4C /* WeakReferenceHarvester.h */,
14E84F9B14EE1ACC00D6D5D4 /* WeakSet.cpp */,
14E84F9C14EE1ACC00D6D5D4 /* WeakSet.h */,
14150132154BB13F005D8C98 /* WeakSetInlines.h */,
0FC8150814043BCA00CFA603 /* WriteBarrierSupport.cpp */,
0FC8150914043BD200CFA603 /* WriteBarrierSupport.h */,
);
......@@ -2563,6 +2566,7 @@
8612E4CD152389EC00C836BE /* MatchResult.h in Headers */,
0F1E3A461534CBAF000F9456 /* DFGArgumentPosition.h in Headers */,
0F1E3A471534CBB9000F9456 /* DFGDoubleFormatState.h in Headers */,
14150133154BB13F005D8C98 /* WeakSetInlines.h in Headers */,
);
runOnlyForDeploymentPostprocessing = 0;
};
......
......@@ -33,6 +33,7 @@
#include "JSLock.h"
#include "JSONObject.h"
#include "Tracing.h"
#include "WeakSetInlines.h"
#include <algorithm>
#include <wtf/CurrentTime.h>
......@@ -953,7 +954,7 @@ void Heap::releaseFreeBlocks()
void Heap::addFinalizer(JSCell* cell, Finalizer finalizer)
{
weakSet()->allocate(cell, &m_finalizerOwner, reinterpret_cast<void*>(finalizer)); // Balanced by FinalizerOwner::finalize().
WeakSet::allocate(cell, &m_finalizerOwner, reinterpret_cast<void*>(finalizer)); // Balanced by FinalizerOwner::finalize().
}
void Heap::FinalizerOwner::finalize(Handle<Unknown> handle, void* context)
......
......@@ -27,6 +27,7 @@
#define PassWeak_h
#include "JSCell.h"
#include "WeakSetInlines.h"
#include <wtf/Assertions.h>
#include <wtf/NullPtr.h>
#include <wtf/TypeTraits.h>
......@@ -57,7 +58,7 @@ public:
PassWeak();
PassWeak(std::nullptr_t);
PassWeak(JSGlobalData&, GetType, WeakHandleOwner* = 0, void* context = 0);
PassWeak(GetType, WeakHandleOwner* = 0, void* context = 0);
// It somewhat breaks the type system to allow transfer of ownership out of
// a const PassWeak. However, it makes it much easier to work with PassWeak
......@@ -118,8 +119,8 @@ template<typename T> inline PassWeak<T>::PassWeak(std::nullptr_t)
{
}
template<typename T> inline PassWeak<T>::PassWeak(JSGlobalData& globalData, typename PassWeak<T>::GetType getType, WeakHandleOwner* weakOwner, void* context)
: m_impl(getType ? globalData.heap.weakSet()->allocate(getType, weakOwner, context) : 0)
template<typename T> inline PassWeak<T>::PassWeak(typename PassWeak<T>::GetType getType, WeakHandleOwner* weakOwner, void* context)
: m_impl(getType ? WeakSet::allocate(getType, weakOwner, context) : 0)
{
}
......
......@@ -27,8 +27,8 @@
#define Weak_h
#include <wtf/Assertions.h>
#include "JSGlobalData.h"
#include "PassWeak.h"
#include "WeakSetInlines.h"
namespace JSC {
......@@ -40,7 +40,7 @@ public:
Weak();
Weak(std::nullptr_t);
Weak(JSGlobalData&, GetType, WeakHandleOwner* = 0, void* context = 0);
Weak(GetType, WeakHandleOwner* = 0, void* context = 0);
enum HashTableDeletedValueTag { HashTableDeletedValue };
bool isHashTableDeletedValue() const;
......@@ -78,8 +78,8 @@ template<typename T> inline Weak<T>::Weak(std::nullptr_t)
{
}
template<typename T> inline Weak<T>::Weak(JSGlobalData& globalData, typename Weak<T>::GetType getType, WeakHandleOwner* weakOwner, void* context)
: m_impl(getType ? globalData.heap.weakSet()->allocate(getType, weakOwner, context) : 0)
template<typename T> inline Weak<T>::Weak(typename Weak<T>::GetType getType, WeakHandleOwner* weakOwner, void* context)
: m_impl(getType ? WeakSet::allocate(getType, weakOwner, context) : 0)
{
}
......
......@@ -39,7 +39,7 @@ public:
void finalizeAll();
~WeakSet();
WeakImpl* allocate(JSValue, WeakHandleOwner* = 0, void* context = 0);
static WeakImpl* allocate(JSValue, WeakHandleOwner* = 0, void* context = 0);
static void deallocate(WeakImpl*);
void visitLiveWeakImpls(HeapRootVisitor&);
......@@ -69,17 +69,6 @@ inline WeakSet::WeakSet(Heap* heap)
{
}
inline WeakImpl* WeakSet::allocate(JSValue jsValue, WeakHandleOwner* weakHandleOwner, void* context)
{
WeakBlock::FreeCell* allocator = m_allocator;
if (UNLIKELY(!allocator))
allocator = findAllocator();
m_allocator = allocator->next;
WeakImpl* weakImpl = WeakBlock::asWeakImpl(allocator);
return new (NotNull, weakImpl) WeakImpl(jsValue, weakHandleOwner, context);
}
inline void WeakSet::deallocate(WeakImpl* weakImpl)
{
weakImpl->setState(WeakImpl::Deallocated);
......
/*
* Copyright (C) 2012 Apple Inc. All rights reserved.
*
* Redistribution and use in source and binary forms, with or without
* modification, are permitted provided that the following conditions
* are met:
* 1. Redistributions of source code must retain the above copyright
* notice, this list of conditions and the following disclaimer.
* 2. Redistributions in binary form must reproduce the above copyright
* notice, this list of conditions and the following disclaimer in the
* documentation and/or other materials provided with the distribution.
*
* THIS SOFTWARE IS PROVIDED BY APPLE INC. AND ITS CONTRIBUTORS ``AS IS''
* AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO,
* THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
* PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL APPLE INC. OR ITS CONTRIBUTORS
* BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
* CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
* SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
* INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
* CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
* ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF
* THE POSSIBILITY OF SUCH DAMAGE.
*/
#ifndef WeakSetInlines_h
#define WeakSetInlines_h
#include "WeakSet.h"
namespace JSC {
inline WeakImpl* WeakSet::allocate(JSValue jsValue, WeakHandleOwner* weakHandleOwner, void* context)
{
WeakSet& weakSet = *Heap::heap(jsValue.asCell())->weakSet();
WeakBlock::FreeCell* allocator = weakSet.m_allocator;
if (UNLIKELY(!allocator))
allocator = weakSet.findAllocator();
weakSet.m_allocator = allocator->next;
WeakImpl* weakImpl = WeakBlock::asWeakImpl(allocator);
return new (NotNull, weakImpl) WeakImpl(jsValue, weakHandleOwner, context);
}
} // namespace JSC
#endif // WeakSetInlines_h
......@@ -3482,7 +3482,7 @@ NativeExecutable* JITThunks::hostFunctionStub(JSGlobalData* globalData, NativeFu
{
HostFunctionStubMap::AddResult result = m_hostFunctionStubMap->add(function, PassWeak<NativeExecutable>());
if (!result.iterator->second)
result.iterator->second = PassWeak<NativeExecutable>(*globalData, NativeExecutable::create(*globalData, JIT::compileCTINativeCall(globalData, function), function, MacroAssemblerCodeRef::createSelfManagedCodeRef(ctiNativeConstruct()), constructor, NoIntrinsic));
result.iterator->second = PassWeak<NativeExecutable>(NativeExecutable::create(*globalData, JIT::compileCTINativeCall(globalData, function), function, MacroAssemblerCodeRef::createSelfManagedCodeRef(ctiNativeConstruct()), constructor, NoIntrinsic));
return result.iterator->second.get();
}
......@@ -3498,7 +3498,7 @@ NativeExecutable* JITThunks::hostFunctionStub(JSGlobalData* globalData, NativeFu
code = MacroAssemblerCodeRef();
} else
code = JIT::compileCTINativeCall(globalData, function);
entry.iterator->second = PassWeak<NativeExecutable>(*globalData, NativeExecutable::create(*globalData, code, function, MacroAssemblerCodeRef::createSelfManagedCodeRef(ctiNativeConstruct()), callHostFunctionAsConstructor, intrinsic));
entry.iterator->second = PassWeak<NativeExecutable>(NativeExecutable::create(*globalData, code, function, MacroAssemblerCodeRef::createSelfManagedCodeRef(ctiNativeConstruct()), callHostFunctionAsConstructor, intrinsic));
}
return entry.iterator->second.get();
}
......
......@@ -46,7 +46,7 @@ RegExp* RegExpCache::lookupOrCreate(const UString& patternString, RegExpFlags fl
// We need to do a second lookup to add the RegExp as
// allocating it may have caused a gc cycle, which in
// turn may have removed items from the cache.
m_weakCache.add(key, PassWeak<RegExp>(*m_globalData, regExp, this));
m_weakCache.add(key, PassWeak<RegExp>(regExp, this));
return regExp;
}
......
......@@ -135,12 +135,12 @@ private:
return 0;
}
void setSingleTransition(JSGlobalData& globalData, Structure* structure)
void setSingleTransition(JSGlobalData&, Structure* structure)
{
ASSERT(isUsingSingleSlot());
if (WeakImpl* impl = this->weakImpl())
WeakSet::deallocate(impl);
WeakImpl* impl = globalData.heap.weakSet()->allocate(reinterpret_cast<JSCell*>(structure));
WeakImpl* impl = WeakSet::allocate(reinterpret_cast<JSCell*>(structure));
m_data = reinterpret_cast<intptr_t>(impl) | UsingSingleSlotFlag;
}
......
......@@ -117,22 +117,22 @@ public:
return HandleTypes<MappedType>::getFromSlot(const_cast<JSValue*>(&m_map.get(key)->jsValue()));
}
AddResult add(JSGlobalData& globalData, const KeyType& key, ExternalType value)
AddResult add(JSGlobalData&, const KeyType& key, ExternalType value)
{
typename MapType::AddResult result = m_map.add(key, 0);
if (result.isNewEntry)
result.iterator->second = globalData.heap.weakSet()->allocate(value, this, FinalizerCallback::finalizerContextFor(key));
result.iterator->second = WeakSet::allocate(value, this, FinalizerCallback::finalizerContextFor(key));
// WeakGCMap exposes a different iterator, so we need to wrap it and create our own AddResult.
return AddResult(iterator(result.iterator), result.isNewEntry);
}
void set(JSGlobalData& globalData, const KeyType& key, ExternalType value)
void set(JSGlobalData&, const KeyType& key, ExternalType value)
{
typename MapType::AddResult result = m_map.add(key, 0);
if (!result.isNewEntry)
WeakSet::deallocate(result.iterator->second);
result.iterator->second = globalData.heap.weakSet()->allocate(value, this, FinalizerCallback::finalizerContextFor(key));
result.iterator->second = WeakSet::allocate(value, this, FinalizerCallback::finalizerContextFor(key));
}
ExternalType take(const KeyType& key)
......
2012-04-27 Geoffrey Garen <ggaren@apple.com>
Made WeakSet::allocate() static and removed its JSGlobalData argument
https://bugs.webkit.org/show_bug.cgi?id=85128
Reviewed by Anders Carlsson.
Mechanically removed JSGlobalData arguments from PassWeak<T> and Weak<T> allocation.
* bindings/js/JSDOMBinding.cpp:
(WebCore::jsStringSlowCase):
* bindings/js/JSEventListener.h:
(WebCore::JSEventListener::setWrapper):
* bindings/js/JSNodeFilterCondition.cpp:
(WebCore::JSNodeFilterCondition::JSNodeFilterCondition):
* bindings/js/ScriptWrappable.h:
(WebCore::ScriptWrappable::setWrapper):
* bridge/jsc/BridgeJSC.cpp:
(JSC::Bindings::Instance::createRuntimeObject):
* bridge/qt/qt_runtime.cpp:
(JSC::Bindings::QtRuntimeMethod::finishCreation):
* bridge/runtime_root.cpp:
(JSC::Bindings::RootObject::addRuntimeObject):
2012-04-27 Mark Rowe <mrowe@apple.com>
<rdar://problem/10346980> REGRESSION: Cannot enter text in Dashboard widget fields that have placeholder attribute
......@@ -49,7 +49,7 @@ const JSC::HashTable* getHashTableForGlobalData(JSGlobalData& globalData, const
JSValue jsStringSlowCase(ExecState* exec, JSStringCache& stringCache, StringImpl* stringImpl)
{
JSString* wrapper = jsString(exec, UString(stringImpl));
stringCache.add(stringImpl, PassWeak<JSString>(exec->globalData(), wrapper, currentWorld(exec)->stringWrapperOwner(), stringImpl));
stringCache.add(stringImpl, PassWeak<JSString>(wrapper, currentWorld(exec)->stringWrapperOwner(), stringImpl));
return wrapper;
}
......
......@@ -141,7 +141,7 @@ enum ParameterDefaultPolicy {
{
if (setInlineCachedWrapper(world, domObject, wrapper))
return;
JSC::PassWeak<JSDOMWrapper> passWeak(*world->globalData(), wrapper, wrapperOwner(world, domObject), wrapperContext(world, domObject));
JSC::PassWeak<JSDOMWrapper> passWeak(wrapper, wrapperOwner(world, domObject), wrapperContext(world, domObject));
DOMObjectWrapperMap::AddResult result = world->m_wrappers.add(domObject, passWeak);
ASSERT_UNUSED(result, result.isNewEntry);
}
......
......@@ -37,7 +37,7 @@ namespace WebCore {
JSEventListener::JSEventListener(JSObject* function, JSObject* wrapper, bool isAttribute, DOMWrapperWorld* isolatedWorld)
: EventListener(JSEventListenerType)
, m_wrapper(*isolatedWorld->globalData(), wrapper)
, m_wrapper(wrapper)
, m_isAttribute(isAttribute)
, m_isolatedWorld(isolatedWorld)
{
......
......@@ -53,7 +53,7 @@ namespace WebCore {
DOMWrapperWorld* isolatedWorld() const { return m_isolatedWorld.get(); }
JSC::JSObject* wrapper() const { return m_wrapper.get(); }
void setWrapper(JSC::JSGlobalData& globalData, JSC::JSObject* wrapper) const { m_wrapper = JSC::PassWeak<JSC::JSObject>(globalData, wrapper, 0); }
void setWrapper(JSC::JSGlobalData&, JSC::JSObject* wrapper) const { m_wrapper = JSC::PassWeak<JSC::JSObject>(wrapper); }
private:
virtual JSC::JSObject* initializeJSFunction(ScriptExecutionContext*) const;
......
......@@ -33,11 +33,9 @@ using namespace JSC;
ASSERT_CLASS_FITS_IN_CELL(JSNodeFilterCondition);
JSNodeFilterCondition::JSNodeFilterCondition(JSGlobalData& globalData, NodeFilter* owner, JSValue filter)
JSNodeFilterCondition::JSNodeFilterCondition(JSGlobalData&, NodeFilter* owner, JSValue filter)
: m_filter(filter.isObject() ? PassWeak<JSObject>(jsCast<JSObject*>(filter), &m_weakOwner, owner) : 0)
{
if (!filter.isObject())
return;
m_filter = PassWeak<JSObject>(globalData, jsCast<JSObject*>(filter), &m_weakOwner, owner);
}
short JSNodeFilterCondition::acceptNode(JSC::ExecState* exec, Node* filterNode) const
......
......@@ -43,10 +43,10 @@ public:
return m_wrapper.get();
}
void setWrapper(JSC::JSGlobalData& globalData, JSDOMWrapper* wrapper, JSC::WeakHandleOwner* wrapperOwner, void* context)
void setWrapper(JSC::JSGlobalData&, JSDOMWrapper* wrapper, JSC::WeakHandleOwner* wrapperOwner, void* context)
{
ASSERT(!m_wrapper);
m_wrapper = JSC::PassWeak<JSDOMWrapper>(globalData, wrapper, wrapperOwner, context);
m_wrapper = JSC::PassWeak<JSDOMWrapper>(wrapper, wrapperOwner, context);
}
void clearWrapper(JSDOMWrapper* wrapper)
......
......@@ -94,7 +94,7 @@ JSObject* Instance::createRuntimeObject(ExecState* exec)
JSLock lock(SilenceAssertionsOnly);
RuntimeObject* newObject = newRuntimeObject(exec);
m_runtimeObject = PassWeak<RuntimeObject>(exec->globalData(), newObject);
m_runtimeObject = PassWeak<RuntimeObject>(newObject);
m_rootObject->addRuntimeObject(exec->globalData(), newObject);
return newObject;
}
......
......@@ -974,12 +974,12 @@ QtRuntimeMethod::QtRuntimeMethod(QtRuntimeMethodData* dd, ExecState* exec, Struc
{
}
void QtRuntimeMethod::finishCreation(ExecState* exec, const Identifier& identifier, PassRefPtr<QtInstance> instance)
void QtRuntimeMethod::finishCreation(ExecState*, const Identifier& identifier, PassRefPtr<QtInstance> instance)
{
Base::finishCreation(exec->globalData(), identifier);
QW_D(QtRuntimeMethod);
d->m_instance = instance;
d->m_finalizer = PassWeak<QtRuntimeMethod>(exec->globalData(), this, d);
d->m_finalizer = PassWeak<QtRuntimeMethod>(this, d);
}
QtRuntimeMethod::~QtRuntimeMethod()
......
......@@ -176,12 +176,12 @@ void RootObject::updateGlobalObject(JSGlobalObject* globalObject)
m_globalObject.set(globalObject->globalData(), globalObject);
}
void RootObject::addRuntimeObject(JSGlobalData& globalData, RuntimeObject* object)
void RootObject::addRuntimeObject(JSGlobalData&, RuntimeObject* object)
{
ASSERT(m_isValid);
ASSERT(!m_runtimeObjects.get(object));
m_runtimeObjects.set(object, JSC::PassWeak<RuntimeObject>(globalData, object, this));
m_runtimeObjects.set(object, JSC::PassWeak<RuntimeObject>(object, this));
}
void RootObject::removeRuntimeObject(RuntimeObject* object)
......
2012-04-27 Geoffrey Garen <ggaren@apple.com>
Made WeakSet::allocate() static and removed its JSGlobalData argument
https://bugs.webkit.org/show_bug.cgi?id=85128
Reviewed by Anders Carlsson.
Mechanically removed JSGlobalData arguments from PassWeak<T> and Weak<T> allocation.
* WebProcess/Plugins/Netscape/NPRuntimeObjectMap.cpp:
(WebKit::NPRuntimeObjectMap::getOrCreateJSObject):
2012-04-27 Yael Aharon <yael.aharon@nokia.com>
[Qt][WK2] Don't call syncRemoteContents from WebLayerTreeRenderer::paintToCurrentGLContext
......@@ -102,7 +102,7 @@ JSObject* NPRuntimeObjectMap::getOrCreateJSObject(JSGlobalObject* globalObject,
return jsNPObject;
JSNPObject* jsNPObject = JSNPObject::create(globalObject, this, npObject);
m_jsNPObjects.set(npObject, JSC::PassWeak<JSNPObject>(globalObject->globalData(), jsNPObject, this, npObject));
m_jsNPObjects.set(npObject, JSC::PassWeak<JSNPObject>(jsNPObject, this, npObject));
return jsNPObject;
}
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment