Commit ff81d056 authored by mhahnenberg@apple.com's avatar mhahnenberg@apple.com

Objective-C API: wrapperClass holds a static JSClassRef, which causes JSGlobalObjects to leak

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

Reviewed by Geoffrey Garen.

Through a very convoluted path that involves the caching of prototypes on the JSClassRef, we can leak 
JSGlobalObjects when inserting an Objective-C object into multiple independent JSContexts.

* API/JSAPIWrapperObject.cpp: Removed.
* API/JSAPIWrapperObject.h:
(JSAPIWrapperObject):
* API/JSAPIWrapperObject.mm: Copied from Source/JavaScriptCore/API/JSAPIWrapperObject.cpp. Made this an
Objective-C++ file so that we can call release on the wrappedObject. Also added a WeakHandleOwner for 
JSAPIWrapperObjects. This will also be used in a future patch for https://bugs.webkit.org/show_bug.cgi?id=112608.
(JSAPIWrapperObjectHandleOwner):
(jsAPIWrapperObjectHandleOwner):
(JSAPIWrapperObjectHandleOwner::finalize): This finalize replaces the old finalize that was done through
the C API.
(JSC::JSAPIWrapperObject::finishCreation): Allocate the WeakImpl. Balanced in finalize.
(JSC::JSAPIWrapperObject::setWrappedObject): We now do the retain of the wrappedObject here rather than in random
places scattered around JSWrapperMap.mm
* API/JSObjectRef.cpp: Added some ifdefs for platforms that don't support the Obj-C API.
(JSObjectGetPrivate): Ditto.
(JSObjectSetPrivate): Ditto.
(JSObjectGetPrivateProperty): Ditto.
(JSObjectSetPrivateProperty): Ditto.
(JSObjectDeletePrivateProperty): Ditto.
* API/JSValueRef.cpp: Ditto.
(JSValueIsObjectOfClass): Ditto.
* API/JSWrapperMap.mm: Remove wrapperClass().
(objectWithCustomBrand): Change to no longer use a parent class, which was only used to give the ability to 
finalize wrapper objects.
(-[JSObjCClassInfo initWithContext:forClass:superClassInfo:]): Change to no longer use wrapperClass(). 
(-[JSObjCClassInfo allocateConstructorAndPrototypeWithSuperClassInfo:]): Ditto.
(tryUnwrapObjcObject): We now check if the object inherits from JSAPIWrapperObject.
* API/tests/testapi.mm: Added a test that exports an Objective-C object to two different JSContexts and makes 
sure that the first one is collected properly by using a weak JSManagedValue for the wrapper in the first JSContext.
* CMakeLists.txt: Build file modifications.
* GNUmakefile.list.am: Ditto.
* JavaScriptCore.gypi: Ditto.
* JavaScriptCore.vcproj/JavaScriptCore/JavaScriptCore.vcproj: Ditto.
* JavaScriptCore.vcxproj/JavaScriptCore.vcxproj: Ditto.
* JavaScriptCore.vcxproj/JavaScriptCore.vcxproj.filters: Ditto.
* JavaScriptCore.xcodeproj/project.pbxproj: Ditto.
* runtime/JSGlobalObject.cpp: More ifdefs for unsupported platforms.
(JSC::JSGlobalObject::reset): Ditto.
(JSC::JSGlobalObject::visitChildren): Ditto.
* runtime/JSGlobalObject.h: Ditto.
(JSGlobalObject): Ditto.
(JSC::JSGlobalObject::objcCallbackFunctionStructure): Ditto.


git-svn-id: http://svn.webkit.org/repository/webkit/trunk@146494 268f45cc-cd09-0410-ab3c-d52691b4dbfc
parent 5d709c14
......@@ -30,16 +30,19 @@
#include "JSDestructibleObject.h"
#include "WeakReferenceHarvester.h"
#if JSC_OBJC_API_ENABLED
namespace JSC {
class JSAPIWrapperObject : public JSDestructibleObject {
public:
typedef JSDestructibleObject Base;
void finishCreation(JSGlobalData&);
static void visitChildren(JSCell*, JSC::SlotVisitor&);
void* wrappedObject() { return m_wrappedObject; }
void setWrappedObject(void* wrappedObject) { m_wrappedObject = wrappedObject; }
void setWrappedObject(void*);
protected:
static const unsigned StructureFlags = OverridesVisitChildren | Base::StructureFlags;
......@@ -52,4 +55,6 @@ private:
} // namespace JSC
#endif
#endif // JSAPIWrapperObject_h
......@@ -33,9 +33,31 @@
#include "Structure.h"
#include "StructureInlines.h"
#if JSC_OBJC_API_ENABLED
class JSAPIWrapperObjectHandleOwner : public JSC::WeakHandleOwner {
public:
virtual void finalize(JSC::Handle<JSC::Unknown>, void*);
};
static JSAPIWrapperObjectHandleOwner* jsAPIWrapperObjectHandleOwner()
{
DEFINE_STATIC_LOCAL(JSAPIWrapperObjectHandleOwner, jsWrapperObjectHandleOwner, ());
return &jsWrapperObjectHandleOwner;
}
void JSAPIWrapperObjectHandleOwner::finalize(JSC::Handle<JSC::Unknown> handle, void*)
{
JSC::WeakSet::deallocate(JSC::WeakImpl::asWeakImpl(handle.slot()));
JSC::JSAPIWrapperObject* wrapperObject = JSC::jsCast<JSC::JSAPIWrapperObject*>(handle.get().asCell());
if (!wrapperObject->wrappedObject())
return;
[static_cast<id>(wrapperObject->wrappedObject()) release];
}
namespace JSC {
template <> const ClassInfo JSCallbackObject<JSAPIWrapperObject>::s_info = { "EnumerableCallbackObject", &Base::s_info, 0, 0, CREATE_METHOD_TABLE(JSCallbackObject) };
template <> const ClassInfo JSCallbackObject<JSAPIWrapperObject>::s_info = { "JSAPIWrapperObject", &Base::s_info, 0, 0, CREATE_METHOD_TABLE(JSCallbackObject) };
template<> const bool JSCallbackObject<JSAPIWrapperObject>::needsDestruction = true;
......@@ -51,6 +73,18 @@ JSAPIWrapperObject::JSAPIWrapperObject(JSGlobalData& globalData, Structure* stru
{
}
void JSAPIWrapperObject::finishCreation(JSGlobalData& globalData)
{
Base::finishCreation(globalData);
WeakSet::allocate(this, jsAPIWrapperObjectHandleOwner(), 0); // Balanced in JSAPIWrapperObjectHandleOwner::finalize.
}
void JSAPIWrapperObject::setWrappedObject(void* wrappedObject)
{
ASSERT(!m_wrappedObject);
m_wrappedObject = [static_cast<id>(wrappedObject) retain];
}
void JSAPIWrapperObject::visitChildren(JSCell* cell, JSC::SlotVisitor& visitor)
{
JSAPIWrapperObject* thisObject = JSC::jsCast<JSAPIWrapperObject*>(cell);
......@@ -62,3 +96,5 @@ void JSAPIWrapperObject::visitChildren(JSCell* cell, JSC::SlotVisitor& visitor)
}
} // namespace JSC
#endif // JSC_OBJC_API_ENABLED
......@@ -346,8 +346,10 @@ void* JSObjectGetPrivate(JSObjectRef object)
return jsCast<JSCallbackObject<JSGlobalObject>*>(jsObject)->getPrivate();
if (jsObject->inherits(&JSCallbackObject<JSDestructibleObject>::s_info))
return jsCast<JSCallbackObject<JSDestructibleObject>*>(jsObject)->getPrivate();
#if JSC_OBJC_API_ENABLED
if (jsObject->inherits(&JSCallbackObject<JSAPIWrapperObject>::s_info))
return jsCast<JSCallbackObject<JSAPIWrapperObject>*>(jsObject)->getPrivate();
#endif
return 0;
}
......@@ -364,10 +366,12 @@ bool JSObjectSetPrivate(JSObjectRef object, void* data)
jsCast<JSCallbackObject<JSDestructibleObject>*>(jsObject)->setPrivate(data);
return true;
}
#if JSC_OBJC_API_ENABLED
if (jsObject->inherits(&JSCallbackObject<JSAPIWrapperObject>::s_info)) {
jsCast<JSCallbackObject<JSAPIWrapperObject>*>(jsObject)->setPrivate(data);
return true;
}
#endif
return false;
}
......@@ -383,8 +387,10 @@ JSValueRef JSObjectGetPrivateProperty(JSContextRef ctx, JSObjectRef object, JSSt
result = jsCast<JSCallbackObject<JSGlobalObject>*>(jsObject)->getPrivateProperty(name);
else if (jsObject->inherits(&JSCallbackObject<JSDestructibleObject>::s_info))
result = jsCast<JSCallbackObject<JSDestructibleObject>*>(jsObject)->getPrivateProperty(name);
#if JSC_OBJC_API_ENABLED
else if (jsObject->inherits(&JSCallbackObject<JSAPIWrapperObject>::s_info))
result = jsCast<JSCallbackObject<JSAPIWrapperObject>*>(jsObject)->getPrivateProperty(name);
#endif
return toRef(exec, result);
}
......@@ -403,10 +409,12 @@ bool JSObjectSetPrivateProperty(JSContextRef ctx, JSObjectRef object, JSStringRe
jsCast<JSCallbackObject<JSDestructibleObject>*>(jsObject)->setPrivateProperty(exec->globalData(), name, jsValue);
return true;
}
#if JSC_OBJC_API_ENABLED
if (jsObject->inherits(&JSCallbackObject<JSAPIWrapperObject>::s_info)) {
jsCast<JSCallbackObject<JSAPIWrapperObject>*>(jsObject)->setPrivateProperty(exec->globalData(), name, jsValue);
return true;
}
#endif
return false;
}
......@@ -424,10 +432,12 @@ bool JSObjectDeletePrivateProperty(JSContextRef ctx, JSObjectRef object, JSStrin
jsCast<JSCallbackObject<JSDestructibleObject>*>(jsObject)->deletePrivateProperty(name);
return true;
}
#if JSC_OBJC_API_ENABLED
if (jsObject->inherits(&JSCallbackObject<JSAPIWrapperObject>::s_info)) {
jsCast<JSCallbackObject<JSAPIWrapperObject>*>(jsObject)->deletePrivateProperty(name);
return true;
}
#endif
return false;
}
......
......@@ -149,8 +149,10 @@ bool JSValueIsObjectOfClass(JSContextRef ctx, JSValueRef value, JSClassRef jsCla
return jsCast<JSCallbackObject<JSGlobalObject>*>(o)->inherits(jsClass);
if (o->inherits(&JSCallbackObject<JSDestructibleObject>::s_info))
return jsCast<JSCallbackObject<JSDestructibleObject>*>(o)->inherits(jsClass);
#if JSC_OBJC_API_ENABLED
if (o->inherits(&JSCallbackObject<JSAPIWrapperObject>::s_info))
return jsCast<JSCallbackObject<JSAPIWrapperObject>*>(o)->inherits(jsClass);
#endif
}
return false;
}
......
......@@ -49,31 +49,6 @@
@end
static void wrapperFinalize(JSObjectRef object)
{
JSC::JSAPIWrapperObject* wrapperObject = JSC::jsCast<JSC::JSAPIWrapperObject*>(toJS(object));
[(id)wrapperObject->wrappedObject() release];
}
// All wrapper objects and constructor objects derive from this type, so we can detect & unwrap Objective-C instances/Classes.
static JSClassRef wrapperClass()
{
static SpinLock initLock = SPINLOCK_INITIALIZER;
SpinLockHolder lockHolder(&initLock);
static JSClassRef classRef = 0;
if (!classRef) {
JSClassDefinition definition;
definition = kJSClassDefinitionEmpty;
definition.className = "objc_class";
definition.finalize = wrapperFinalize;
classRef = JSClassCreate(&definition);
}
return classRef;
}
// Default conversion of selectors to property names.
// All semicolons are removed, lowercase letters following a semicolon are capitalized.
static NSString *selectorToPropertyName(const char* start)
......@@ -135,12 +110,11 @@ static JSObjectRef makeWrapper(JSContextRef ctx, JSClassRef jsClass, id wrappedO
// Make an object that is in all ways a completely vanilla JavaScript object,
// other than that it has a native brand set that will be displayed by the default
// Object.prototype.toString conversion.
static JSValue *objectWithCustomBrand(JSContext *context, NSString *brand, JSClassRef parentClass = 0, Class cls = 0)
static JSValue *objectWithCustomBrand(JSContext *context, NSString *brand, Class cls = 0)
{
JSClassDefinition definition;
definition = kJSClassDefinitionEmpty;
definition.className = [brand UTF8String];
definition.parentClass = parentClass;
JSClassRef classRef = JSClassCreate(&definition);
JSObjectRef result = makeWrapper([context globalContextRef], classRef, cls);
JSClassRelease(classRef);
......@@ -342,7 +316,6 @@ static void copyPrototypeProperties(JSContext *context, Class objcClass, Protoco
JSClassDefinition definition;
definition = kJSClassDefinitionEmpty;
definition.className = className;
definition.parentClass = wrapperClass();
m_classRef = JSClassCreate(&definition);
[self allocateConstructorAndPrototypeWithSuperClassInfo:superClassInfo];
......@@ -384,7 +357,7 @@ static void copyPrototypeProperties(JSContext *context, Class objcClass, Protoco
if (m_constructor)
constructor = [JSValue valueWithValue:toRef(m_constructor.get()) inContext:m_context];
else
constructor = objectWithCustomBrand(m_context, [NSString stringWithFormat:@"%sConstructor", className], wrapperClass(), [m_class retain]);
constructor = objectWithCustomBrand(m_context, [NSString stringWithFormat:@"%sConstructor", className], m_class);
JSContextRef cContext = [m_context globalContextRef];
m_prototype = toJS(JSValueToObject(cContext, valueInternalValue(prototype), 0));
......@@ -422,7 +395,7 @@ static void copyPrototypeProperties(JSContext *context, Class objcClass, Protoco
[self reallocateConstructorAndOrPrototype];
ASSERT(!!m_prototype);
JSObjectRef wrapper = makeWrapper([m_context globalContextRef], m_classRef, [object retain]);
JSObjectRef wrapper = makeWrapper([m_context globalContextRef], m_classRef, object);
JSObjectSetPrototype([m_context globalContextRef], wrapper, toRef(m_prototype.get()));
return [JSValue valueWithValue:wrapper inContext:m_context];
}
......@@ -525,7 +498,7 @@ id tryUnwrapObjcObject(JSGlobalContextRef context, JSValueRef value)
JSValueRef exception = 0;
JSObjectRef object = JSValueToObject(context, value, &exception);
ASSERT(!exception);
if (JSValueIsObjectOfClass(context, object, wrapperClass()))
if (toJS(object)->inherits(&JSC::JSCallbackObject<JSC::JSAPIWrapperObject>::s_info))
return (id)JSC::jsCast<JSC::JSAPIWrapperObject*>(toJS(object))->wrappedObject();
if (id target = tryUnwrapBlock(object))
return target;
......
......@@ -523,7 +523,6 @@ void testObjectiveCAPI()
TestObject *testObject = [TestObject testObject];
context[@"testObject"] = testObject;
JSValue *result = [context evaluateScript:@"Function.prototype.toString.call(testObject.callback)"];
NSLog(@"toString = %@", [result toString]);
checkResult(@"Function.prototype.toString", !context.exception && ![result isUndefined]);
}
......@@ -629,6 +628,26 @@ void testObjectiveCAPI()
checkResult(@"Event handler onclick doesn't fire", ![result toBool]);
}
}
@autoreleasepool {
JSVirtualMachine *vm = [[JSVirtualMachine alloc] init];
TestObject *testObject = [TestObject testObject];
JSManagedValue *weakValue;
@autoreleasepool {
JSContext *context = [[JSContext alloc] initWithVirtualMachine:vm];
context[@"testObject"] = testObject;
weakValue = [[JSManagedValue alloc] initWithValue:context[@"testObject"]];
}
@autoreleasepool {
JSContext *context = [[JSContext alloc] initWithVirtualMachine:vm];
context[@"testObject"] = testObject;
JSSynchronousGarbageCollectForDebugging([context globalContextRef]);
checkResult(@"weak value == nil", ![weakValue value]);
checkResult(@"root is still alive", ![context[@"testObject"] isUndefined]);
}
}
}
#else
......
......@@ -24,7 +24,6 @@ set(JavaScriptCore_INCLUDE_DIRECTORIES
)
set(JavaScriptCore_SOURCES
API/JSAPIWrapperObject.cpp
API/JSBase.cpp
API/JSCallbackConstructor.cpp
API/JSCallbackFunction.cpp
......
2013-03-21 Mark Hahnenberg <mhahnenberg@apple.com>
Objective-C API: wrapperClass holds a static JSClassRef, which causes JSGlobalObjects to leak
https://bugs.webkit.org/show_bug.cgi?id=112856
Reviewed by Geoffrey Garen.
Through a very convoluted path that involves the caching of prototypes on the JSClassRef, we can leak
JSGlobalObjects when inserting an Objective-C object into multiple independent JSContexts.
* API/JSAPIWrapperObject.cpp: Removed.
* API/JSAPIWrapperObject.h:
(JSAPIWrapperObject):
* API/JSAPIWrapperObject.mm: Copied from Source/JavaScriptCore/API/JSAPIWrapperObject.cpp. Made this an
Objective-C++ file so that we can call release on the wrappedObject. Also added a WeakHandleOwner for
JSAPIWrapperObjects. This will also be used in a future patch for https://bugs.webkit.org/show_bug.cgi?id=112608.
(JSAPIWrapperObjectHandleOwner):
(jsAPIWrapperObjectHandleOwner):
(JSAPIWrapperObjectHandleOwner::finalize): This finalize replaces the old finalize that was done through
the C API.
(JSC::JSAPIWrapperObject::finishCreation): Allocate the WeakImpl. Balanced in finalize.
(JSC::JSAPIWrapperObject::setWrappedObject): We now do the retain of the wrappedObject here rather than in random
places scattered around JSWrapperMap.mm
* API/JSObjectRef.cpp: Added some ifdefs for platforms that don't support the Obj-C API.
(JSObjectGetPrivate): Ditto.
(JSObjectSetPrivate): Ditto.
(JSObjectGetPrivateProperty): Ditto.
(JSObjectSetPrivateProperty): Ditto.
(JSObjectDeletePrivateProperty): Ditto.
* API/JSValueRef.cpp: Ditto.
(JSValueIsObjectOfClass): Ditto.
* API/JSWrapperMap.mm: Remove wrapperClass().
(objectWithCustomBrand): Change to no longer use a parent class, which was only used to give the ability to
finalize wrapper objects.
(-[JSObjCClassInfo initWithContext:forClass:superClassInfo:]): Change to no longer use wrapperClass().
(-[JSObjCClassInfo allocateConstructorAndPrototypeWithSuperClassInfo:]): Ditto.
(tryUnwrapObjcObject): We now check if the object inherits from JSAPIWrapperObject.
* API/tests/testapi.mm: Added a test that exports an Objective-C object to two different JSContexts and makes
sure that the first one is collected properly by using a weak JSManagedValue for the wrapper in the first JSContext.
* CMakeLists.txt: Build file modifications.
* GNUmakefile.list.am: Ditto.
* JavaScriptCore.gypi: Ditto.
* JavaScriptCore.vcproj/JavaScriptCore/JavaScriptCore.vcproj: Ditto.
* JavaScriptCore.vcxproj/JavaScriptCore.vcxproj: Ditto.
* JavaScriptCore.vcxproj/JavaScriptCore.vcxproj.filters: Ditto.
* JavaScriptCore.xcodeproj/project.pbxproj: Ditto.
* runtime/JSGlobalObject.cpp: More ifdefs for unsupported platforms.
(JSC::JSGlobalObject::reset): Ditto.
(JSC::JSGlobalObject::visitChildren): Ditto.
* runtime/JSGlobalObject.h: Ditto.
(JSGlobalObject): Ditto.
(JSC::JSGlobalObject::objcCallbackFunctionStructure): Ditto.
2013-03-21 Anton Muhin <antonm@chromium.org>
Unreviewed, rolling out r146483.
......
......@@ -34,7 +34,6 @@ javascriptcore_built_nosources += \
javascriptcore_sources += \
Source/JavaScriptCore/API/APICast.h \
Source/JavaScriptCore/API/APIShims.h \
Source/JavaScriptCore/API/JSAPIWrapperObject.cpp \
Source/JavaScriptCore/API/JSAPIWrapperObject.h \
Source/JavaScriptCore/API/JSBase.cpp \
Source/JavaScriptCore/API/JSBasePrivate.h \
......
......@@ -36,7 +36,6 @@
'API/APIShims.h',
'API/JavaScriptCore.h',
'API/JavaScript.h',
'API/JSAPIWrapperObject.cpp',
'API/JSAPIWrapperObject.h',
'API/JSBase.cpp',
'API/JSBase.h',
......
......@@ -1417,10 +1417,6 @@
RelativePath="..\..\runtime\JSAPIValueWrapper.h"
>
</File>
<File
RelativePath="..\..\API\JSAPIWrapperObject.cpp"
>
</File>
<File
RelativePath="..\..\API\JSAPIWrapperObject.h"
>
......
......@@ -144,7 +144,6 @@
<Link />
</ItemDefinitionGroup>
<ItemGroup>
<ClCompile Include="..\API\JSAPIWrapperObject.cpp" />
<ClCompile Include="..\API\JSBase.cpp" />
<ClCompile Include="..\API\JSCallbackConstructor.cpp" />
<ClCompile Include="..\API\JSCallbackFunction.cpp" />
......@@ -785,4 +784,4 @@
<Import Project="$(VCTargetsPath)\Microsoft.Cpp.targets" />
<ImportGroup Label="ExtensionTargets">
</ImportGroup>
</Project>
\ No newline at end of file
</Project>
......@@ -750,9 +750,6 @@
<ClCompile Include="..\runtime\PropertyTable.cpp">
<Filter>runtime</Filter>
</ClCompile>
<ClCompile Include="..\API\JSAPIWrapperObject.cpp">
<Filter>API</Filter>
</ClCompile>
</ItemGroup>
<ItemGroup>
<ClInclude Include="..\API\APICast.h">
......@@ -1918,4 +1915,4 @@
<None Include="JavaScriptCorePreBuild.cmd" />
<None Include="copy-files.cmd" />
</ItemGroup>
</Project>
\ No newline at end of file
</Project>
......@@ -843,7 +843,7 @@
C2C8D02D14A3C6E000578E65 /* CopiedSpaceInlines.h in Headers */ = {isa = PBXBuildFile; fileRef = C2C8D02B14A3C6B200578E65 /* CopiedSpaceInlines.h */; settings = {ATTRIBUTES = (Private, ); }; };
C2C8D03014A3CEFC00578E65 /* CopiedBlock.h in Headers */ = {isa = PBXBuildFile; fileRef = C2C8D02E14A3CEFC00578E65 /* CopiedBlock.h */; settings = {ATTRIBUTES = (Private, ); }; };
C2C8D03114A3CEFC00578E65 /* HeapBlock.h in Headers */ = {isa = PBXBuildFile; fileRef = C2C8D02F14A3CEFC00578E65 /* HeapBlock.h */; settings = {ATTRIBUTES = (Private, ); }; };
C2CF39C116E15A8100DD69BE /* JSAPIWrapperObject.cpp in Sources */ = {isa = PBXBuildFile; fileRef = C2CF39BF16E15A8100DD69BE /* JSAPIWrapperObject.cpp */; };
C2CF39C116E15A8100DD69BE /* JSAPIWrapperObject.mm in Sources */ = {isa = PBXBuildFile; fileRef = C2CF39BF16E15A8100DD69BE /* JSAPIWrapperObject.mm */; };
C2CF39C216E15A8100DD69BE /* JSAPIWrapperObject.h in Headers */ = {isa = PBXBuildFile; fileRef = C2CF39C016E15A8100DD69BE /* JSAPIWrapperObject.h */; };
C2D58C3415912FEE0021A844 /* GCActivityCallback.cpp in Sources */ = {isa = PBXBuildFile; fileRef = C2D58C3315912FEE0021A844 /* GCActivityCallback.cpp */; };
C2E526BD1590EF000054E48D /* HeapTimer.cpp in Sources */ = {isa = PBXBuildFile; fileRef = C2E526BB1590EF000054E48D /* HeapTimer.cpp */; };
......@@ -1745,7 +1745,7 @@
C2C8D02B14A3C6B200578E65 /* CopiedSpaceInlines.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = CopiedSpaceInlines.h; sourceTree = "<group>"; };
C2C8D02E14A3CEFC00578E65 /* CopiedBlock.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = CopiedBlock.h; sourceTree = "<group>"; };
C2C8D02F14A3CEFC00578E65 /* HeapBlock.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = HeapBlock.h; sourceTree = "<group>"; };
C2CF39BF16E15A8100DD69BE /* JSAPIWrapperObject.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = JSAPIWrapperObject.cpp; sourceTree = "<group>"; };
C2CF39BF16E15A8100DD69BE /* JSAPIWrapperObject.mm */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.objcpp; path = JSAPIWrapperObject.mm; sourceTree = "<group>"; };
C2CF39C016E15A8100DD69BE /* JSAPIWrapperObject.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = JSAPIWrapperObject.h; sourceTree = "<group>"; };
C2D58C3315912FEE0021A844 /* GCActivityCallback.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = GCActivityCallback.cpp; sourceTree = "<group>"; };
C2E526BB1590EF000054E48D /* HeapTimer.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = HeapTimer.cpp; sourceTree = "<group>"; };
......@@ -2222,7 +2222,7 @@
5DE3D0F40DD8DDFB00468714 /* WebKitAvailability.h */,
C25D709916DE99F400FCA6BC /* JSManagedValue.mm */,
C25D709A16DE99F400FCA6BC /* JSManagedValue.h */,
C2CF39BF16E15A8100DD69BE /* JSAPIWrapperObject.cpp */,
C2CF39BF16E15A8100DD69BE /* JSAPIWrapperObject.mm */,
C2CF39C016E15A8100DD69BE /* JSAPIWrapperObject.h */,
);
path = API;
......@@ -3812,7 +3812,7 @@
0FD3C82614115D4000FD81CB /* DFGDriver.cpp in Sources */,
0FF0F19E16B72A0B005DF95B /* DFGEdge.cpp in Sources */,
0FBC0AE71496C7C400D4FBDD /* DFGExitProfile.cpp in Sources */,
C2CF39C116E15A8100DD69BE /* JSAPIWrapperObject.cpp in Sources */,
C2CF39C116E15A8100DD69BE /* JSAPIWrapperObject.mm in Sources */,
0F2BDC15151C5D4D00CD8910 /* DFGFixupPhase.cpp in Sources */,
86EC9DC71328DF82002B2AD7 /* DFGGraph.cpp in Sources */,
86EC9DCB1328DF82002B2AD7 /* DFGJITCompiler.cpp in Sources */,
......
......@@ -33,7 +33,6 @@ INSTALLDEPS += all
debug_and_release: INCLUDEPATH += $$JAVASCRIPTCORE_GENERATED_SOURCES_DIR/$$targetSubDir()
SOURCES += \
API/JSAPIWrapperObject.cpp \
API/JSBase.cpp \
API/JSCallbackConstructor.cpp \
API/JSCallbackFunction.cpp \
......
......@@ -233,8 +233,8 @@ void JSGlobalObject::reset(JSValue prototype)
m_callbackObjectStructure.set(exec->globalData(), this, JSCallbackObject<JSDestructibleObject>::createStructure(exec->globalData(), this, m_objectPrototype.get()));
#if JSC_OBJC_API_ENABLED
m_objcCallbackFunctionStructure.set(exec->globalData(), this, ObjCCallbackFunction::createStructure(exec->globalData(), this, m_functionPrototype.get()));
#endif
m_objcWrapperObjectStructure.set(exec->globalData(), this, JSCallbackObject<JSAPIWrapperObject>::createStructure(exec->globalData(), this, m_objectPrototype.get()));
#endif
m_arrayPrototype.set(exec->globalData(), this, ArrayPrototype::create(exec, this, ArrayPrototype::createStructure(exec->globalData(), this, m_objectPrototype.get())));
......@@ -519,8 +519,8 @@ void JSGlobalObject::visitChildren(JSCell* cell, SlotVisitor& visitor)
visitor.append(&thisObject->m_callbackObjectStructure);
#if JSC_OBJC_API_ENABLED
visitor.append(&thisObject->m_objcCallbackFunctionStructure);
#endif
visitor.append(&thisObject->m_objcWrapperObjectStructure);
#endif
visitor.append(&thisObject->m_dateStructure);
visitor.append(&thisObject->m_nullPrototypeObjectStructure);
visitor.append(&thisObject->m_errorStructure);
......
......@@ -144,8 +144,8 @@ protected:
WriteBarrier<Structure> m_callbackObjectStructure;
#if JSC_OBJC_API_ENABLED
WriteBarrier<Structure> m_objcCallbackFunctionStructure;
#endif
WriteBarrier<Structure> m_objcWrapperObjectStructure;
#endif
WriteBarrier<Structure> m_dateStructure;
WriteBarrier<Structure> m_nullPrototypeObjectStructure;
WriteBarrier<Structure> m_errorStructure;
......@@ -307,8 +307,8 @@ public:
Structure* callbackObjectStructure() const { return m_callbackObjectStructure.get(); }
#if JSC_OBJC_API_ENABLED
Structure* objcCallbackFunctionStructure() const { return m_objcCallbackFunctionStructure.get(); }
#endif
Structure* objcWrapperObjectStructure() const { return m_objcWrapperObjectStructure.get(); }
#endif
Structure* dateStructure() const { return m_dateStructure.get(); }
Structure* nullPrototypeObjectStructure() const { return m_nullPrototypeObjectStructure.get(); }
Structure* errorStructure() const { return m_errorStructure.get(); }
......
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