Use APIEntryShim instead of JSLock in SerializedScriptValue.
authortimothy@apple.com <timothy@apple.com@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Thu, 3 Mar 2011 18:28:29 +0000 (18:28 +0000)
committertimothy@apple.com <timothy@apple.com@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Thu, 3 Mar 2011 18:28:29 +0000 (18:28 +0000)
Source/JavaScriptCore: Make APIShims usable from WebCore.

Reviewed by Oliver Hunt.

* ForwardingHeaders/JavaScriptCore/APIShims.h: Added.
* GNUmakefile.am:
* JavaScriptCore.exp:
* JavaScriptCore.gypi:
* JavaScriptCore.vcproj/JavaScriptCore/JavaScriptCoreGenerated.make:
* JavaScriptCore.xcodeproj/project.pbxproj:

Source/WebCore: Use APIEntryShim instead of JSLock in SerializedScriptValue to allow it to be used
by contexts not created by WebCore.

https://webkit.org/b/55642

Reviewed by Oliver Hunt.

* bindings/js/SerializedScriptValue.cpp:
(WebCore::SerializedScriptValue::create): Use APIEntryShim instead of JSLock.
(WebCore::SerializedScriptValue::deserialize): Ditto.

git-svn-id: https://svn.webkit.org/repository/webkit/trunk@80254 268f45cc-cd09-0410-ab3c-d52691b4dbfc

Source/JavaScriptCore/ChangeLog
Source/JavaScriptCore/ForwardingHeaders/JavaScriptCore/APIShims.h [new file with mode: 0644]
Source/JavaScriptCore/GNUmakefile.am
Source/JavaScriptCore/JavaScriptCore.exp
Source/JavaScriptCore/JavaScriptCore.gypi
Source/JavaScriptCore/JavaScriptCore.vcproj/JavaScriptCore/JavaScriptCoreGenerated.make
Source/JavaScriptCore/JavaScriptCore.xcodeproj/project.pbxproj
Source/WebCore/ChangeLog
Source/WebCore/bindings/js/SerializedScriptValue.cpp

index e3f3c2e..0a23900 100644 (file)
@@ -1,3 +1,16 @@
+2011-03-03  Timothy Hatcher  <timothy@apple.com>
+
+        Make APIShims usable from WebCore.
+
+        Reviewed by Oliver Hunt.
+
+        * ForwardingHeaders/JavaScriptCore/APIShims.h: Added.
+        * GNUmakefile.am:
+        * JavaScriptCore.exp:
+        * JavaScriptCore.gypi:
+        * JavaScriptCore.vcproj/JavaScriptCore/JavaScriptCoreGenerated.make:
+        * JavaScriptCore.xcodeproj/project.pbxproj:
+
 2011-03-03  Peter Varga  <pvarga@webkit.org>
 
         Reviewed by Oliver Hunt.
diff --git a/Source/JavaScriptCore/ForwardingHeaders/JavaScriptCore/APIShims.h b/Source/JavaScriptCore/ForwardingHeaders/JavaScriptCore/APIShims.h
new file mode 100644 (file)
index 0000000..92e712a
--- /dev/null
@@ -0,0 +1 @@
+#include <JavaScriptCore/API/APIShims.h>
index 1afb96c..babac89 100644 (file)
@@ -122,6 +122,7 @@ javascriptcore_sources += \
        Source/JavaScriptCore/debugger/Debugger.cpp \
        Source/JavaScriptCore/debugger/Debugger.h \
        Source/JavaScriptCore/ForwardingHeaders/JavaScriptCore/APICast.h \
+       Source/JavaScriptCore/ForwardingHeaders/JavaScriptCore/APIShims.h \
        Source/JavaScriptCore/ForwardingHeaders/JavaScriptCore/JavaScriptCore.h \
        Source/JavaScriptCore/ForwardingHeaders/JavaScriptCore/JavaScript.h \
        Source/JavaScriptCore/ForwardingHeaders/JavaScriptCore/JSBase.h \
index 11c41ca..6baa4d5 100644 (file)
@@ -184,6 +184,7 @@ __ZN3JSC17PropertyNameArray3addEPN3WTF10StringImplE
 __ZN3JSC17constructFunctionEPNS_9ExecStateERKNS_7ArgListERKNS_10IdentifierERKNS_7UStringEi
 __ZN3JSC17createSyntaxErrorEPNS_9ExecStateERKNS_7UStringE
 __ZN3JSC18DebuggerActivationC1ERNS_12JSGlobalDataEPNS_8JSObjectE
+__ZN3JSC18MachineStackMarker14registerThreadEv
 __ZN3JSC18PropertyDescriptor11setWritableEb
 __ZN3JSC18PropertyDescriptor12setUndefinedEv
 __ZN3JSC18PropertyDescriptor13setDescriptorENS_7JSValueEj
@@ -209,6 +210,7 @@ __ZN3JSC24createStackOverflowErrorEPNS_9ExecStateE
 __ZN3JSC25evaluateInGlobalCallFrameERKNS_7UStringERNS_7JSValueEPNS_14JSGlobalObjectE
 __ZN3JSC35createInterruptedExecutionExceptionEPNS_12JSGlobalDataE
 __ZN3JSC3NaNE
+__ZN3JSC4Heap16activityCallbackEv
 __ZN3JSC4Heap16allocateSlowCaseEm
 __ZN3JSC4Heap16objectTypeCountsEv
 __ZN3JSC4Heap17collectAllGarbageEv
index 4e33fe2..09972e1 100644 (file)
@@ -15,6 +15,7 @@
         # These headers are part of JavaScriptCore's private API in the Apple Mac build.
         'javascriptcore_privateheader_files': [
             'API/APICast.h',
+            'API/APIShims.h',
             'API/JSBasePrivate.h',
             'API/JSContextRefPrivate.h',
             'API/JSObjectRefPrivate.h',
             'API/OpaqueJSString.cpp',
             'AllInOneFile.cpp',
             'ForwardingHeaders/JavaScriptCore/APICast.h',
+            'ForwardingHeaders/JavaScriptCore/APIShims.h',
             'ForwardingHeaders/JavaScriptCore/JSBase.h',
             'ForwardingHeaders/JavaScriptCore/JSContextRef.h',
             'ForwardingHeaders/JavaScriptCore/JSObjectRef.h',
index db2a175..ba95c46 100644 (file)
@@ -6,6 +6,7 @@ all:
 !ENDIF
     -mkdir 2>NUL "%ConfigurationBuildDir%\include\JavaScriptCore"
     xcopy /y /d "..\..\API\APICast.h" "%ConfigurationBuildDir%\include\JavaScriptCore"
+    xcopy /y /d "..\..\API\APIShims.h" "%ConfigurationBuildDir%\include\JavaScriptCore"
     xcopy /y /d "..\..\API\JavaScript.h" "%ConfigurationBuildDir%\include\JavaScriptCore"
     xcopy /y /d "..\..\API\JSBase.h" "%ConfigurationBuildDir%\include\JavaScriptCore"
     xcopy /y /d "..\..\API\JSContextRef.h" "%ConfigurationBuildDir%\include\JavaScriptCore"
index 47eb4e2..08622bb 100644 (file)
                86438FC41265503E00E0DFCA /* StringBuilder.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 86438FC31265503E00E0DFCA /* StringBuilder.cpp */; };
                86565742115BE3DA00291F40 /* CString.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 86565740115BE3DA00291F40 /* CString.cpp */; };
                86565743115BE3DA00291F40 /* CString.h in Headers */ = {isa = PBXBuildFile; fileRef = 86565741115BE3DA00291F40 /* CString.h */; settings = {ATTRIBUTES = (Private, ); }; };
-               865F408810E7D56300947361 /* APIShims.h in Headers */ = {isa = PBXBuildFile; fileRef = 865F408710E7D56300947361 /* APIShims.h */; };
+               865F408810E7D56300947361 /* APIShims.h in Headers */ = {isa = PBXBuildFile; fileRef = 865F408710E7D56300947361 /* APIShims.h */; settings = {ATTRIBUTES = (Private, ); }; };
                86676D5211FED9BC004B6863 /* BumpPointerAllocator.h in Headers */ = {isa = PBXBuildFile; fileRef = 86676D4D11FED55D004B6863 /* BumpPointerAllocator.h */; settings = {ATTRIBUTES = (Private, ); }; };
                86704B4212DB8A8100A9FE7B /* YarrSyntaxChecker.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 86704B4012DB8A8100A9FE7B /* YarrSyntaxChecker.cpp */; };
                86704B4312DB8A8100A9FE7B /* YarrSyntaxChecker.h in Headers */ = {isa = PBXBuildFile; fileRef = 86704B4112DB8A8100A9FE7B /* YarrSyntaxChecker.h */; };
                BCFD8C930EEB2EE700283848 /* JumpTable.h in Headers */ = {isa = PBXBuildFile; fileRef = BCFD8C910EEB2EE700283848 /* JumpTable.h */; };
                C0A272630E50A06300E96E15 /* NotFound.h in Headers */ = {isa = PBXBuildFile; fileRef = C0A2723F0E509F1E00E96E15 /* NotFound.h */; settings = {ATTRIBUTES = (Private, ); }; };
                DD377CBC12072C18006A2517 /* Bitmap.h in Headers */ = {isa = PBXBuildFile; fileRef = DD377CBB12072C18006A2517 /* Bitmap.h */; settings = {ATTRIBUTES = (Private, ); }; };
-               DDF7ABD411F60ED200108E36 /* GCActivityCallback.h in Headers */ = {isa = PBXBuildFile; fileRef = DDF7ABD211F60ED200108E36 /* GCActivityCallback.h */; };
+               DDF7ABD411F60ED200108E36 /* GCActivityCallback.h in Headers */ = {isa = PBXBuildFile; fileRef = DDF7ABD211F60ED200108E36 /* GCActivityCallback.h */; settings = {ATTRIBUTES = (Private, ); }; };
                DDF7ABD511F60ED200108E36 /* GCActivityCallbackCF.cpp in Sources */ = {isa = PBXBuildFile; fileRef = DDF7ABD311F60ED200108E36 /* GCActivityCallbackCF.cpp */; };
                E124A8F70E555775003091F1 /* OpaqueJSString.h in Headers */ = {isa = PBXBuildFile; fileRef = E124A8F50E555775003091F1 /* OpaqueJSString.h */; settings = {ATTRIBUTES = (Private, ); }; };
                E124A8F80E555775003091F1 /* OpaqueJSString.cpp in Sources */ = {isa = PBXBuildFile; fileRef = E124A8F60E555775003091F1 /* OpaqueJSString.cpp */; };
index 4d978db..b7d7803 100644 (file)
@@ -1,3 +1,16 @@
+2011-03-03  Timothy Hatcher  <timothy@apple.com>
+
+        Use APIEntryShim instead of JSLock in SerializedScriptValue to allow it to be used
+        by contexts not created by WebCore.
+
+        https://webkit.org/b/55642
+
+        Reviewed by Oliver Hunt.
+
+        * bindings/js/SerializedScriptValue.cpp:
+        (WebCore::SerializedScriptValue::create): Use APIEntryShim instead of JSLock.
+        (WebCore::SerializedScriptValue::deserialize): Ditto.
+
 2011-03-03  Alexey Proskuryakov  <ap@apple.com>
 
         Reviewed by Darin Adler.
index 41ad198..b3d07ca 100644 (file)
 #include "SharedBuffer.h"
 #include <limits>
 #include <JavaScriptCore/APICast.h>
+#include <JavaScriptCore/APIShims.h>
 #include <runtime/DateInstance.h>
 #include <runtime/Error.h>
 #include <runtime/ExceptionHelpers.h>
-#include <runtime/JSLock.h>
 #include <runtime/PropertyNameArray.h>
 #include <runtime/RegExp.h>
 #include <runtime/RegExpObject.h>
@@ -1381,8 +1381,8 @@ PassRefPtr<SerializedScriptValue> SerializedScriptValue::create(String string)
 
 PassRefPtr<SerializedScriptValue> SerializedScriptValue::create(JSContextRef originContext, JSValueRef apiValue, JSValueRef* exception)
 {
-    JSLock lock(SilenceAssertionsOnly);
     ExecState* exec = toJS(originContext);
+    APIEntryShim entryShim(exec);
     JSValue value = toJS(exec, apiValue);
     PassRefPtr<SerializedScriptValue> serializedValue = SerializedScriptValue::create(exec, value);
     if (exec->hadException()) {
@@ -1407,8 +1407,8 @@ JSValue SerializedScriptValue::deserialize(ExecState* exec, JSGlobalObject* glob
 
 JSValueRef SerializedScriptValue::deserialize(JSContextRef destinationContext, JSValueRef* exception)
 {
-    JSLock lock(SilenceAssertionsOnly);
     ExecState* exec = toJS(destinationContext);
+    APIEntryShim entryShim(exec);
     JSValue value = deserialize(exec, exec->lexicalGlobalObject());
     if (exec->hadException()) {
         if (exception)