Title: [273777] trunk/Source
Revision
273777
Author
[email protected]
Date
2021-03-02 17:37:34 -0800 (Tue, 02 Mar 2021)

Log Message

[JSC] Remove ImpureProxyType
https://bugs.webkit.org/show_bug.cgi?id=222626

Reviewed by Alexey Shvayka.

Source/_javascript_Core:

ImpureProxyType is no longer used. This patch just removes it.

* API/tests/JSObjectGetProxyTargetTest.cpp:
(testJSObjectGetProxyTarget):
* runtime/HasOwnPropertyCache.h:
(JSC::HasOwnPropertyCache::tryAdd):
* runtime/JSCast.h:
* runtime/JSCellInlines.h:
(JSC::JSCell::isProxy const):
* runtime/JSGlobalObject.cpp:
(JSC::JSGlobalObject::resetPrototype):
(JSC::JSGlobalObject::finishCreation):
* runtime/JSProxy.h:
(JSC::JSProxy::createStructure):
* runtime/JSType.cpp:
(WTF::printInternal):
* runtime/JSType.h:
* runtime/Structure.h:
(JSC::Structure::isProxy const):
* tools/JSDollarVM.cpp:
(JSC::JSC_DEFINE_HOST_FUNCTION):

Source/WebCore:

* workers/WorkerOrWorkletScriptController.cpp:
(WebCore::WorkerOrWorkletScriptController::initScriptWithSubclass):

Modified Paths

Diff

Modified: trunk/Source/_javascript_Core/API/tests/JSObjectGetProxyTargetTest.cpp (273776 => 273777)


--- trunk/Source/_javascript_Core/API/tests/JSObjectGetProxyTargetTest.cpp	2021-03-03 01:25:52 UTC (rev 273776)
+++ trunk/Source/_javascript_Core/API/tests/JSObjectGetProxyTargetTest.cpp	2021-03-03 01:37:34 UTC (rev 273777)
@@ -60,7 +60,7 @@
         JSLockHolder locker(vm);
         JSProxy* globalObjectProxyObject = jsCast<JSProxy*>(toJS(globalObjectProxy));
         globalObjectObject = jsCast<JSGlobalObject*>(globalObjectProxyObject->target());
-        Structure* proxyStructure = JSProxy::createStructure(vm, globalObjectObject, globalObjectObject->objectPrototype(), PureForwardingProxyType);
+        Structure* proxyStructure = JSProxy::createStructure(vm, globalObjectObject, globalObjectObject->objectPrototype());
         globalObjectRef = toRef(jsCast<JSObject*>(globalObjectObject));
         jsProxyObject = JSProxy::create(vm, proxyStructure);
     }

Modified: trunk/Source/_javascript_Core/ChangeLog (273776 => 273777)


--- trunk/Source/_javascript_Core/ChangeLog	2021-03-03 01:25:52 UTC (rev 273776)
+++ trunk/Source/_javascript_Core/ChangeLog	2021-03-03 01:37:34 UTC (rev 273777)
@@ -1,3 +1,32 @@
+2021-03-02  Yusuke Suzuki  <[email protected]>
+
+        [JSC] Remove ImpureProxyType
+        https://bugs.webkit.org/show_bug.cgi?id=222626
+
+        Reviewed by Alexey Shvayka.
+
+        ImpureProxyType is no longer used. This patch just removes it.
+
+        * API/tests/JSObjectGetProxyTargetTest.cpp:
+        (testJSObjectGetProxyTarget):
+        * runtime/HasOwnPropertyCache.h:
+        (JSC::HasOwnPropertyCache::tryAdd):
+        * runtime/JSCast.h:
+        * runtime/JSCellInlines.h:
+        (JSC::JSCell::isProxy const):
+        * runtime/JSGlobalObject.cpp:
+        (JSC::JSGlobalObject::resetPrototype):
+        (JSC::JSGlobalObject::finishCreation):
+        * runtime/JSProxy.h:
+        (JSC::JSProxy::createStructure):
+        * runtime/JSType.cpp:
+        (WTF::printInternal):
+        * runtime/JSType.h:
+        * runtime/Structure.h:
+        (JSC::Structure::isProxy const):
+        * tools/JSDollarVM.cpp:
+        (JSC::JSC_DEFINE_HOST_FUNCTION):
+
 2021-03-02  Saam Barati  <[email protected]>
 
         Improve logging of OSR availability analysis validation failures

Modified: trunk/Source/_javascript_Core/runtime/HasOwnPropertyCache.h (273776 => 273777)


--- trunk/Source/_javascript_Core/runtime/HasOwnPropertyCache.h	2021-03-03 01:25:52 UTC (rev 273776)
+++ trunk/Source/_javascript_Core/runtime/HasOwnPropertyCache.h	2021-03-03 01:37:34 UTC (rev 273777)
@@ -87,7 +87,7 @@
         if (!slot.isCacheable() && !slot.isUnset())
             return;
 
-        if (object->type() == PureForwardingProxyType || object->type() == ImpureProxyType)
+        if (object->type() == PureForwardingProxyType)
             return;
 
         Structure* structure = object->structure(vm);

Modified: trunk/Source/_javascript_Core/runtime/JSCast.h (273776 => 273777)


--- trunk/Source/_javascript_Core/runtime/JSCast.h	2021-03-03 01:25:52 UTC (rev 273776)
+++ trunk/Source/_javascript_Core/runtime/JSCast.h	2021-03-03 01:37:34 UTC (rev 273777)
@@ -79,7 +79,7 @@
     macro(JSArrayBuffer, JSType::ArrayBufferType, JSType::ArrayBufferType) \
     macro(JSArrayBufferView, FirstTypedArrayType, LastTypedArrayType) \
     macro(JSPromise, JSType::JSPromiseType, JSType::JSPromiseType) \
-    macro(JSProxy, JSType::PureForwardingProxyType, JSType::ImpureProxyType) \
+    macro(JSProxy, JSType::PureForwardingProxyType, JSType::PureForwardingProxyType) \
     macro(JSSet, JSType::JSSetType, JSType::JSSetType) \
     macro(JSMap, JSType::JSMapType, JSType::JSMapType) \
     macro(JSWeakSet, JSType::JSWeakSetType, JSType::JSWeakSetType) \

Modified: trunk/Source/_javascript_Core/runtime/JSCellInlines.h (273776 => 273777)


--- trunk/Source/_javascript_Core/runtime/JSCellInlines.h	2021-03-03 01:25:52 UTC (rev 273776)
+++ trunk/Source/_javascript_Core/runtime/JSCellInlines.h	2021-03-03 01:37:34 UTC (rev 273777)
@@ -244,7 +244,7 @@
 
 inline bool JSCell::isProxy() const
 {
-    return m_type == ImpureProxyType || m_type == PureForwardingProxyType || m_type == ProxyObjectType;
+    return m_type == PureForwardingProxyType || m_type == ProxyObjectType;
 }
 
 // FIXME: Consider making getCallData concurrency-safe once NPAPI support is removed.

Modified: trunk/Source/_javascript_Core/runtime/JSGlobalObject.cpp (273776 => 273777)


--- trunk/Source/_javascript_Core/runtime/JSGlobalObject.cpp	2021-03-03 01:25:52 UTC (rev 273776)
+++ trunk/Source/_javascript_Core/runtime/JSGlobalObject.cpp	2021-03-03 01:37:34 UTC (rev 273777)
@@ -1903,7 +1903,7 @@
     setPrototypeDirect(vm, prototype);
     fixupPrototypeChainWithObjectPrototype(vm);
     // Whenever we change the prototype of the global object, we need to create a new JSProxy with the correct prototype.
-    setGlobalThis(vm, JSProxy::create(vm, JSProxy::createStructure(vm, this, prototype, PureForwardingProxyType), this));
+    setGlobalThis(vm, JSProxy::create(vm, JSProxy::createStructure(vm, this, prototype), this));
 }
 
 template<typename Visitor>
@@ -2376,7 +2376,7 @@
     structure(vm)->setGlobalObject(vm, this);
     m_runtimeFlags = m_globalObjectMethodTable->_javascript_RuntimeFlags(this);
     init(vm);
-    setGlobalThis(vm, JSProxy::create(vm, JSProxy::createStructure(vm, this, getPrototypeDirect(vm), PureForwardingProxyType), this));
+    setGlobalThis(vm, JSProxy::create(vm, JSProxy::createStructure(vm, this, getPrototypeDirect(vm)), this));
     ASSERT(type() == GlobalObjectType);
 }
 

Modified: trunk/Source/_javascript_Core/runtime/JSProxy.h (273776 => 273777)


--- trunk/Source/_javascript_Core/runtime/JSProxy.h	2021-03-03 01:25:52 UTC (rev 273776)
+++ trunk/Source/_javascript_Core/runtime/JSProxy.h	2021-03-03 01:37:34 UTC (rev 273777)
@@ -55,10 +55,9 @@
         return proxy;
     }
 
-    static Structure* createStructure(VM& vm, JSGlobalObject* globalObject, JSValue prototype, JSType proxyType)
+    static Structure* createStructure(VM& vm, JSGlobalObject* globalObject, JSValue prototype)
     {
-        ASSERT(proxyType == ImpureProxyType || proxyType == PureForwardingProxyType);
-        return Structure::create(vm, globalObject, prototype, TypeInfo(proxyType, StructureFlags), info());
+        return Structure::create(vm, globalObject, prototype, TypeInfo(PureForwardingProxyType, StructureFlags), info());
     }
 
     DECLARE_EXPORT_INFO;

Modified: trunk/Source/_javascript_Core/runtime/JSType.cpp (273776 => 273777)


--- trunk/Source/_javascript_Core/runtime/JSType.cpp	2021-03-03 01:25:52 UTC (rev 273776)
+++ trunk/Source/_javascript_Core/runtime/JSType.cpp	2021-03-03 01:37:34 UTC (rev 273777)
@@ -68,7 +68,6 @@
     CASE(NumberObjectType)
     CASE(ErrorInstanceType)
     CASE(PureForwardingProxyType)
-    CASE(ImpureProxyType)
     CASE(DirectArgumentsType)
     CASE(ScopedArgumentsType)
     CASE(ClonedArgumentsType)

Modified: trunk/Source/_javascript_Core/runtime/JSType.h (273776 => 273777)


--- trunk/Source/_javascript_Core/runtime/JSType.h	2021-03-03 01:25:52 UTC (rev 273776)
+++ trunk/Source/_javascript_Core/runtime/JSType.h	2021-03-03 01:37:34 UTC (rev 273777)
@@ -65,7 +65,6 @@
     NumberObjectType,
     ErrorInstanceType,
     PureForwardingProxyType,
-    ImpureProxyType,
     DirectArgumentsType,
     ScopedArgumentsType,
     ClonedArgumentsType,

Modified: trunk/Source/_javascript_Core/runtime/Structure.h (273776 => 273777)


--- trunk/Source/_javascript_Core/runtime/Structure.h	2021-03-03 01:25:52 UTC (rev 273776)
+++ trunk/Source/_javascript_Core/runtime/Structure.h	2021-03-03 01:37:34 UTC (rev 273777)
@@ -183,7 +183,7 @@
     bool isProxy() const
     {
         JSType type = m_blob.type();
-        return type == ImpureProxyType || type == PureForwardingProxyType || type == ProxyObjectType;
+        return type == PureForwardingProxyType || type == ProxyObjectType;
     }
 
     static void dumpStatistics();

Modified: trunk/Source/_javascript_Core/tools/JSDollarVM.cpp (273776 => 273777)


--- trunk/Source/_javascript_Core/tools/JSDollarVM.cpp	2021-03-03 01:25:52 UTC (rev 273776)
+++ trunk/Source/_javascript_Core/tools/JSDollarVM.cpp	2021-03-03 01:37:34 UTC (rev 273777)
@@ -2715,7 +2715,7 @@
     if (!target.isObject())
         return JSValue::encode(jsUndefined());
     JSObject* jsTarget = asObject(target.asCell());
-    Structure* structure = JSProxy::createStructure(vm, globalObject, jsTarget->getPrototypeDirect(vm), ImpureProxyType);
+    Structure* structure = JSProxy::createStructure(vm, globalObject, jsTarget->getPrototypeDirect(vm));
     JSProxy* proxy = JSProxy::create(vm, structure, jsTarget);
     return JSValue::encode(proxy);
 }

Modified: trunk/Source/WebCore/ChangeLog (273776 => 273777)


--- trunk/Source/WebCore/ChangeLog	2021-03-03 01:25:52 UTC (rev 273776)
+++ trunk/Source/WebCore/ChangeLog	2021-03-03 01:37:34 UTC (rev 273777)
@@ -1,3 +1,13 @@
+2021-03-02  Yusuke Suzuki  <[email protected]>
+
+        [JSC] Remove ImpureProxyType
+        https://bugs.webkit.org/show_bug.cgi?id=222626
+
+        Reviewed by Alexey Shvayka.
+
+        * workers/WorkerOrWorkletScriptController.cpp:
+        (WebCore::WorkerOrWorkletScriptController::initScriptWithSubclass):
+
 2021-03-02  Sam Weinig  <[email protected]>
 
         Reduce the size of extended colors by storing the color space in free bits of the owning Color

Modified: trunk/Source/WebCore/workers/WorkerOrWorkletScriptController.cpp (273776 => 273777)


--- trunk/Source/WebCore/workers/WorkerOrWorkletScriptController.cpp	2021-03-03 01:25:52 UTC (rev 273776)
+++ trunk/Source/WebCore/workers/WorkerOrWorkletScriptController.cpp	2021-03-03 01:37:34 UTC (rev 273777)
@@ -488,7 +488,7 @@
     Structure* contextPrototypeStructure = JSGlobalScopePrototype::createStructure(*m_vm, nullptr, jsNull());
     auto* contextPrototype = JSGlobalScopePrototype::create(*m_vm, nullptr, contextPrototypeStructure);
     Structure* structure = JSGlobalScope::createStructure(*m_vm, nullptr, contextPrototype);
-    auto* proxyStructure = JSProxy::createStructure(*m_vm, nullptr, jsNull(), PureForwardingProxyType);
+    auto* proxyStructure = JSProxy::createStructure(*m_vm, nullptr, jsNull());
     auto* proxy = JSProxy::create(*m_vm, proxyStructure);
 
     m_globalScopeWrapper.set(*m_vm, JSGlobalScope::create(*m_vm, structure, static_cast<GlobalScope&>(*m_globalScope), proxy));
_______________________________________________
webkit-changes mailing list
[email protected]
https://lists.webkit.org/mailman/listinfo/webkit-changes

Reply via email to