Skip to content
Permalink
Browse files
Use APIEntryShim instead of JSLock in SerializedScriptValue.
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.

Canonical link: https://commits.webkit.org/70149@main
git-svn-id: https://svn.webkit.org/repository/webkit/trunk@80254 268f45cc-cd09-0410-ab3c-d52691b4dbfc
  • Loading branch information
xeenon committed Mar 3, 2011
1 parent 8e0ffc1 commit 2977937739358dab5ab3191932b26c76318a3b07
@@ -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.
@@ -0,0 +1 @@
#include <JavaScriptCore/API/APIShims.h>
@@ -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 \
@@ -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
@@ -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',
@@ -251,6 +252,7 @@
'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',
@@ -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"
@@ -225,7 +225,7 @@
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 */; };
@@ -555,7 +555,7 @@
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 */; };
@@ -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.
@@ -39,10 +39,10 @@
#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)

0 comments on commit 2977937

Please sign in to comment.