Title: [98177] trunk/Source
Revision
98177
Author
[email protected]
Date
2011-10-21 17:48:40 -0700 (Fri, 21 Oct 2011)

Log Message

Add put to the MethodTable
https://bugs.webkit.org/show_bug.cgi?id=70439

Reviewed by Oliver Hunt.

Source/_javascript_Core: 

* _javascript_Core.exp:
* _javascript_Core.vcproj/_javascript_Core/_javascript_Core.def:
* runtime/ClassInfo.h: Added put and putByIndex to the MethodTable.
* runtime/JSFunction.h: Changed access modifier for put to protected since some
subclasses of JSFunction need to reference it in their MethodTables.

Source/WebCore: 

No new tests.

* WebCore.exp.in:
* bindings/js/JSDOMWindowCustom.cpp: Added static put since it was overlooked in 
previous patches.
(WebCore::JSDOMWindow::putVirtual):
(WebCore::JSDOMWindow::put):
* bindings/js/JSDOMWindowShell.cpp: Ditto.
(WebCore::JSDOMWindowShell::putVirtual):
(WebCore::JSDOMWindowShell::put):
* bindings/js/JSDOMWindowShell.h:

Modified Paths

Diff

Modified: trunk/Source/_javascript_Core/ChangeLog (98176 => 98177)


--- trunk/Source/_javascript_Core/ChangeLog	2011-10-22 00:39:56 UTC (rev 98176)
+++ trunk/Source/_javascript_Core/ChangeLog	2011-10-22 00:48:40 UTC (rev 98177)
@@ -1,5 +1,18 @@
 2011-10-21  Mark Hahnenberg  <[email protected]>
 
+        Add put to the MethodTable
+        https://bugs.webkit.org/show_bug.cgi?id=70439
+
+        Reviewed by Oliver Hunt.
+
+        * _javascript_Core.exp:
+        * _javascript_Core.vcproj/_javascript_Core/_javascript_Core.def:
+        * runtime/ClassInfo.h: Added put and putByIndex to the MethodTable.
+        * runtime/JSFunction.h: Changed access modifier for put to protected since some
+        subclasses of JSFunction need to reference it in their MethodTables.
+
+2011-10-21  Mark Hahnenberg  <[email protected]>
+
         Add finalizer to JSObject
         https://bugs.webkit.org/show_bug.cgi?id=70336
 

Modified: trunk/Source/_javascript_Core/_javascript_Core.exp (98176 => 98177)


--- trunk/Source/_javascript_Core/_javascript_Core.exp	2011-10-22 00:39:56 UTC (rev 98176)
+++ trunk/Source/_javascript_Core/_javascript_Core.exp	2011-10-22 00:48:40 UTC (rev 98177)
@@ -115,7 +115,9 @@
 __ZN3JSC10JSFunctionC1EPNS_9ExecStateEPNS_14JSGlobalObjectEPNS_9StructureE
 __ZN3JSC10throwErrorEPNS_9ExecStateENS_7JSValueE
 __ZN3JSC10throwErrorEPNS_9ExecStateEPNS_8JSObjectE
+__ZN3JSC11JSByteArray10putByIndexEPNS_6JSCellEPNS_9ExecStateEjNS_7JSValueE
 __ZN3JSC11JSByteArray15createStructureERNS_12JSGlobalDataEPNS_14JSGlobalObjectENS_7JSValueEPKNS_9ClassInfoE
+__ZN3JSC11JSByteArray3putEPNS_6JSCellEPNS_9ExecStateERKNS_10IdentifierENS_7JSValueERNS_15PutPropertySlotE
 __ZN3JSC11JSByteArray6s_infoE
 __ZN3JSC11JSByteArrayC1EPNS_9ExecStateEPNS_9StructureEPN3WTF9ByteArrayE
 __ZN3JSC11ParserArena5resetEv
@@ -305,6 +307,7 @@
 __ZN3JSC8Debugger6attachEPNS_14JSGlobalObjectE
 __ZN3JSC8Debugger6detachEPNS_14JSGlobalObjectE
 __ZN3JSC8DebuggerD2Ev
+__ZN3JSC8JSObject10putByIndexEPNS_6JSCellEPNS_9ExecStateEjNS_7JSValueE
 __ZN3JSC8JSObject10putVirtualEPNS_9ExecStateERKNS_10IdentifierENS_7JSValueERNS_15PutPropertySlotE
 __ZN3JSC8JSObject10putVirtualEPNS_9ExecStateEjNS_7JSValueE
 __ZN3JSC8JSObject11hasInstanceEPNS_9ExecStateENS_7JSValueES3_

Modified: trunk/Source/_javascript_Core/_javascript_Core.vcproj/_javascript_Core/_javascript_Core.def (98176 => 98177)


--- trunk/Source/_javascript_Core/_javascript_Core.vcproj/_javascript_Core/_javascript_Core.def	2011-10-22 00:39:56 UTC (rev 98176)
+++ trunk/Source/_javascript_Core/_javascript_Core.vcproj/_javascript_Core/_javascript_Core.def	2011-10-22 00:48:40 UTC (rev 98177)
@@ -271,8 +271,11 @@
     ?protectedGlobalObjectCount@Heap@JSC@@QAEIXZ
     ?protectedObjectCount@Heap@JSC@@QAEIXZ
     ?protectedObjectTypeCounts@Heap@JSC@@QAE?AV?$PassOwnPtr@V?$HashCountedSet@PBDU?$PtrHash@PBD@WTF@@U?$HashTraits@PBD@2@@WTF@@@WTF@@XZ
+    ?put@JSByteArray@JSC@@SAXPAVJSCell@2@PAVExecState@2@ABVIdentifier@2@VJSValue@2@AAVPutPropertySlot@2@@Z
     ?put@JSGlobalObject@JSC@@SAXPAVJSCell@2@PAVExecState@2@ABVIdentifier@2@VJSValue@2@AAVPutPropertySlot@2@@Z
     ?put@JSObject@JSC@@SAXPAVJSCell@2@PAVExecState@2@ABVIdentifier@2@VJSValue@2@AAVPutPropertySlot@2@@Z
+    ?putByIndex@JSByteArray@JSC@@SAXPAVJSCell@2@PAVExecState@2@IVJSValue@2@@Z
+    ?putByIndex@JSObject@JSC@@SAXPAVJSCell@2@PAVExecState@2@IVJSValue@2@@Z
     ?putDirectInternal@JSObject@JSC@@AAE_NAAVJSGlobalData@2@ABVIdentifier@2@VJSValue@2@I_NAAVPutPropertySlot@2@PAVJSCell@2@@Z
     ?putVirtual@JSCell@JSC@@UAEXPAVExecState@2@ABVIdentifier@2@VJSValue@2@AAVPutPropertySlot@2@@Z
     ?putVirtual@JSCell@JSC@@UAEXPAVExecState@2@IVJSValue@2@@Z

Modified: trunk/Source/_javascript_Core/runtime/ClassInfo.h (98176 => 98177)


--- trunk/Source/_javascript_Core/runtime/ClassInfo.h	2011-10-22 00:39:56 UTC (rev 98176)
+++ trunk/Source/_javascript_Core/runtime/ClassInfo.h	2011-10-22 00:48:40 UTC (rev 98177)
@@ -40,12 +40,20 @@
 
         typedef ConstructType (*GetConstructDataFunctionPtr)(JSCell*, ConstructData&);
         GetConstructDataFunctionPtr getConstructData;
+
+        typedef void (*PutFunctionPtr)(JSCell*, ExecState*, const Identifier& propertyName, JSValue, PutPropertySlot&);
+        PutFunctionPtr put;
+
+        typedef void (*PutByIndexFunctionPtr)(JSCell*, ExecState*, unsigned propertyName, JSValue);
+        PutByIndexFunctionPtr putByIndex;
     };
 
 #define CREATE_METHOD_TABLE(ClassName) { \
         &ClassName::visitChildren, \
         &ClassName::getCallData, \
         &ClassName::getConstructData, \
+        &ClassName::put, \
+        &ClassName::putByIndex, \
     }, \
     sizeof(ClassName)
 

Modified: trunk/Source/_javascript_Core/runtime/JSFunction.h (98176 => 98177)


--- trunk/Source/_javascript_Core/runtime/JSFunction.h	2011-10-22 00:39:56 UTC (rev 98176)
+++ trunk/Source/_javascript_Core/runtime/JSFunction.h	2011-10-22 00:48:40 UTC (rev 98177)
@@ -133,6 +133,9 @@
         virtual bool getOwnPropertyDescriptor(ExecState*, const Identifier&, PropertyDescriptor&);
         virtual void getOwnPropertyNames(ExecState*, PropertyNameArray&, EnumerationMode = ExcludeDontEnumProperties);
 
+        virtual void putVirtual(ExecState*, const Identifier& propertyName, JSValue, PutPropertySlot&);
+        static void put(JSCell*, ExecState*, const Identifier& propertyName, JSValue, PutPropertySlot&);
+
         static void visitChildren(JSCell*, SlotVisitor&);
 
     private:
@@ -140,9 +143,6 @@
 
         bool isHostFunctionNonInline() const;
 
-        virtual void putVirtual(ExecState*, const Identifier& propertyName, JSValue, PutPropertySlot&);
-        static void put(JSCell*, ExecState*, const Identifier& propertyName, JSValue, PutPropertySlot&);
-
         virtual bool deletePropertyVirtual(ExecState*, const Identifier& propertyName);
         static bool deleteProperty(JSCell*, ExecState*, const Identifier& propertyName);
 

Modified: trunk/Source/WebCore/ChangeLog (98176 => 98177)


--- trunk/Source/WebCore/ChangeLog	2011-10-22 00:39:56 UTC (rev 98176)
+++ trunk/Source/WebCore/ChangeLog	2011-10-22 00:48:40 UTC (rev 98177)
@@ -1,3 +1,22 @@
+2011-10-21  Mark Hahnenberg  <[email protected]>
+
+        Add put to the MethodTable
+        https://bugs.webkit.org/show_bug.cgi?id=70439
+
+        Reviewed by Oliver Hunt.
+
+        No new tests.
+
+        * WebCore.exp.in:
+        * bindings/js/JSDOMWindowCustom.cpp: Added static put since it was overlooked in 
+        previous patches.
+        (WebCore::JSDOMWindow::putVirtual):
+        (WebCore::JSDOMWindow::put):
+        * bindings/js/JSDOMWindowShell.cpp: Ditto.
+        (WebCore::JSDOMWindowShell::putVirtual):
+        (WebCore::JSDOMWindowShell::put):
+        * bindings/js/JSDOMWindowShell.h:
+
 2011-10-21  Dmitry Lomov  <[email protected]>
 
         https://bugs.webkit.org/show_bug.cgi?id=70580

Modified: trunk/Source/WebCore/WebCore.exp.in (98176 => 98177)


--- trunk/Source/WebCore/WebCore.exp.in	2011-10-22 00:39:56 UTC (rev 98176)
+++ trunk/Source/WebCore/WebCore.exp.in	2011-10-22 00:48:40 UTC (rev 98177)
@@ -1707,6 +1707,7 @@
 __ZN3JSC8Bindings13RuntimeObject21deletePropertyVirtualEPNS_9ExecStateERKNS_10IdentifierE
 __ZN3JSC8Bindings13RuntimeObject24getOwnPropertyDescriptorEPNS_9ExecStateERKNS_10IdentifierERNS_18PropertyDescriptorE
 __ZN3JSC8Bindings13RuntimeObject25getOwnPropertySlotVirtualEPNS_9ExecStateERKNS_10IdentifierERNS_12PropertySlotE
+__ZN3JSC8Bindings13RuntimeObject3putEPNS_6JSCellEPNS_9ExecStateERKNS_10IdentifierENS_7JSValueERNS_15PutPropertySlotE
 __ZN3JSC8Bindings13RuntimeObject6s_infoE
 __ZN3JSC8Bindings13RuntimeObjectC2EPNS_9ExecStateEPNS_14JSGlobalObjectEPNS_9StructureEN3WTF10PassRefPtrINS0_8InstanceEEE
 __ZN3JSC8Bindings13RuntimeObjectD2Ev

Modified: trunk/Source/WebCore/bindings/js/JSDOMWindowCustom.cpp (98176 => 98177)


--- trunk/Source/WebCore/bindings/js/JSDOMWindowCustom.cpp	2011-10-22 00:39:56 UTC (rev 98176)
+++ trunk/Source/WebCore/bindings/js/JSDOMWindowCustom.cpp	2011-10-22 00:48:40 UTC (rev 98177)
@@ -346,21 +346,27 @@
 
 void JSDOMWindow::putVirtual(ExecState* exec, const Identifier& propertyName, JSValue value, PutPropertySlot& slot)
 {
-    if (!impl()->frame())
+    put(this, exec, propertyName, value, slot);
+}
+
+void JSDOMWindow::put(JSCell* cell, ExecState* exec, const Identifier& propertyName, JSValue value, PutPropertySlot& slot)
+{
+    JSDOMWindow* thisObject = static_cast<JSDOMWindow*>(cell);
+    if (!thisObject->impl()->frame())
         return;
 
     // Optimization: access _javascript_ global variables directly before involving the DOM.
-    if (JSGlobalObject::hasOwnPropertyForWrite(exec, propertyName)) {
-        if (allowsAccessFrom(exec))
-            JSGlobalObject::put(this, exec, propertyName, value, slot);
+    if (thisObject->JSGlobalObject::hasOwnPropertyForWrite(exec, propertyName)) {
+        if (thisObject->allowsAccessFrom(exec))
+            JSGlobalObject::put(thisObject, exec, propertyName, value, slot);
         return;
     }
 
-    if (lookupPut<JSDOMWindow>(exec, propertyName, value, s_info.propHashTable(exec), this))
+    if (lookupPut<JSDOMWindow>(exec, propertyName, value, s_info.propHashTable(exec), thisObject))
         return;
 
-    if (allowsAccessFrom(exec))
-        Base::put(this, exec, propertyName, value, slot);
+    if (thisObject->allowsAccessFrom(exec))
+        Base::put(thisObject, exec, propertyName, value, slot);
 }
 
 bool JSDOMWindow::deletePropertyVirtual(ExecState* exec, const Identifier& propertyName)

Modified: trunk/Source/WebCore/bindings/js/JSDOMWindowShell.cpp (98176 => 98177)


--- trunk/Source/WebCore/bindings/js/JSDOMWindowShell.cpp	2011-10-22 00:39:56 UTC (rev 98176)
+++ trunk/Source/WebCore/bindings/js/JSDOMWindowShell.cpp	2011-10-22 00:48:40 UTC (rev 98177)
@@ -117,9 +117,14 @@
 
 void JSDOMWindowShell::putVirtual(ExecState* exec, const Identifier& propertyName, JSValue value, PutPropertySlot& slot)
 {
-    m_window->putVirtual(exec, propertyName, value, slot);
+    put(this, exec, propertyName, value, slot);
 }
 
+void JSDOMWindowShell::put(JSCell* cell, ExecState* exec, const Identifier& propertyName, JSValue value, PutPropertySlot& slot)
+{
+    static_cast<JSDOMWindowShell*>(cell)->m_window->putVirtual(exec, propertyName, value, slot);
+}
+
 void JSDOMWindowShell::putWithAttributes(ExecState* exec, const Identifier& propertyName, JSValue value, unsigned attributes)
 {
     m_window->putWithAttributes(exec, propertyName, value, attributes);

Modified: trunk/Source/WebCore/bindings/js/JSDOMWindowShell.h (98176 => 98177)


--- trunk/Source/WebCore/bindings/js/JSDOMWindowShell.h	2011-10-22 00:39:56 UTC (rev 98176)
+++ trunk/Source/WebCore/bindings/js/JSDOMWindowShell.h	2011-10-22 00:48:40 UTC (rev 98177)
@@ -84,6 +84,7 @@
         static bool getOwnPropertySlot(JSC::JSCell*, JSC::ExecState*, const JSC::Identifier& propertyName, JSC::PropertySlot&);
         virtual bool getOwnPropertyDescriptor(JSC::ExecState*, const JSC::Identifier& propertyName, JSC::PropertyDescriptor&);
         virtual void putVirtual(JSC::ExecState*, const JSC::Identifier& propertyName, JSC::JSValue, JSC::PutPropertySlot&);
+        static void put(JSC::JSCell*, JSC::ExecState*, const JSC::Identifier& propertyName, JSC::JSValue, JSC::PutPropertySlot&);
         virtual void putWithAttributes(JSC::ExecState*, const JSC::Identifier& propertyName, JSC::JSValue, unsigned attributes);
         virtual bool deletePropertyVirtual(JSC::ExecState*, const JSC::Identifier& propertyName);
         virtual void getPropertyNames(JSC::ExecState*, JSC::PropertyNameArray&, JSC::EnumerationMode mode = JSC::ExcludeDontEnumProperties);
_______________________________________________
webkit-changes mailing list
[email protected]
http://lists.webkit.org/mailman/listinfo.cgi/webkit-changes

Reply via email to