- Revision
- 196702
- Author
- barraclo...@apple.com
- Date
- 2016-02-17 11:04:11 -0800 (Wed, 17 Feb 2016)
Log Message
JSDOMWindow::put should not do the same thing twice
https://bugs.webkit.org/show_bug.cgi?id=154334
Reviewed by Chris Dumez.
It either calls JSGlobalObject::put or Base::put. Hint: these are basically the same thing.
In the latter case it might call lookupPut. That's redundant; JSObject::put handles static
table entries.
Source/_javascript_Core:
* runtime/JSGlobalObject.h:
(JSC::JSGlobalObject::hasOwnPropertyForWrite): Deleted.
- no longer needed.
Source/WebCore:
* bindings/js/JSDOMWindowCustom.cpp:
(WebCore::JSDOMWindow::put):
- just call Base::put.
(WebCore::JSDOMWindow::putByIndex):
- just call Base::putByIndex.
Modified Paths
Diff
Modified: trunk/Source/_javascript_Core/ChangeLog (196701 => 196702)
--- trunk/Source/_javascript_Core/ChangeLog 2016-02-17 19:03:47 UTC (rev 196701)
+++ trunk/Source/_javascript_Core/ChangeLog 2016-02-17 19:04:11 UTC (rev 196702)
@@ -1,3 +1,18 @@
+2016-02-17 Gavin Barraclough <barraclo...@apple.com>
+
+ JSDOMWindow::put should not do the same thing twice
+ https://bugs.webkit.org/show_bug.cgi?id=154334
+
+ Reviewed by Chris Dumez.
+
+ It either calls JSGlobalObject::put or Base::put. Hint: these are basically the same thing.
+ In the latter case it might call lookupPut. That's redundant; JSObject::put handles static
+ table entries.
+
+ * runtime/JSGlobalObject.h:
+ (JSC::JSGlobalObject::hasOwnPropertyForWrite): Deleted.
+ - no longer needed.
+
2016-02-16 Filip Pizlo <fpi...@apple.com>
FTL_USES_B3 should be unconditionally true
Modified: trunk/Source/_javascript_Core/runtime/JSGlobalObject.h (196701 => 196702)
--- trunk/Source/_javascript_Core/runtime/JSGlobalObject.h 2016-02-17 19:03:47 UTC (rev 196701)
+++ trunk/Source/_javascript_Core/runtime/JSGlobalObject.h 2016-02-17 19:04:11 UTC (rev 196702)
@@ -396,7 +396,6 @@
JS_EXPORT_PRIVATE static void visitChildren(JSCell*, SlotVisitor&);
JS_EXPORT_PRIVATE static bool getOwnPropertySlot(JSObject*, ExecState*, PropertyName, PropertySlot&);
- bool hasOwnPropertyForWrite(ExecState*, PropertyName);
JS_EXPORT_PRIVATE static void put(JSCell*, ExecState*, PropertyName, JSValue, PutPropertySlot&);
JS_EXPORT_PRIVATE static void defineGetter(JSObject*, ExecState*, PropertyName, JSObject* getterFunc, unsigned attributes);
@@ -717,15 +716,6 @@
return jsCast<JSGlobalObject*>(asObject(value));
}
-inline bool JSGlobalObject::hasOwnPropertyForWrite(ExecState* exec, PropertyName propertyName)
-{
- PropertySlot slot(this);
- if (Base::getOwnPropertySlot(this, exec, propertyName, slot))
- return true;
- bool slotIsWriteable;
- return symbolTableGet(this, propertyName, slot, slotIsWriteable);
-}
-
inline JSArray* constructEmptyArray(ExecState* exec, ArrayAllocationProfile* profile, JSGlobalObject* globalObject, unsigned initialLength = 0, JSValue newTarget = JSValue())
{
Structure* structure;
Modified: trunk/Source/WebCore/ChangeLog (196701 => 196702)
--- trunk/Source/WebCore/ChangeLog 2016-02-17 19:03:47 UTC (rev 196701)
+++ trunk/Source/WebCore/ChangeLog 2016-02-17 19:04:11 UTC (rev 196702)
@@ -1,3 +1,20 @@
+2016-02-17 Gavin Barraclough <barraclo...@apple.com>
+
+ JSDOMWindow::put should not do the same thing twice
+ https://bugs.webkit.org/show_bug.cgi?id=154334
+
+ Reviewed by Chris Dumez.
+
+ It either calls JSGlobalObject::put or Base::put. Hint: these are basically the same thing.
+ In the latter case it might call lookupPut. That's redundant; JSObject::put handles static
+ table entries.
+
+ * bindings/js/JSDOMWindowCustom.cpp:
+ (WebCore::JSDOMWindow::put):
+ - just call Base::put.
+ (WebCore::JSDOMWindow::putByIndex):
+ - just call Base::putByIndex.
+
2016-02-17 Nan Wang <n_w...@apple.com>
AX: Implement sentence related text marker functions using TextIterator
Modified: trunk/Source/WebCore/bindings/js/JSDOMWindowCustom.cpp (196701 => 196702)
--- trunk/Source/WebCore/bindings/js/JSDOMWindowCustom.cpp 2016-02-17 19:03:47 UTC (rev 196701)
+++ trunk/Source/WebCore/bindings/js/JSDOMWindowCustom.cpp 2016-02-17 19:04:11 UTC (rev 196702)
@@ -356,17 +356,6 @@
return;
}
- // Optimization: access _javascript_ global variables directly before involving the DOM.
- if (thisObject->JSGlobalObject::hasOwnPropertyForWrite(exec, propertyName)) {
- JSGlobalObject::put(thisObject, exec, propertyName, value, slot);
- return;
- }
-
- if (!thisObject->staticFunctionsReified()) {
- if (lookupPut(exec, propertyName, thisObject, value, *s_info.staticPropHashTable, slot))
- return;
- }
-
Base::put(thisObject, exec, propertyName, value, slot);
}
@@ -376,12 +365,6 @@
if (!thisObject->wrapped().frame() || !BindingSecurity::shouldAllowAccessToDOMWindow(exec, thisObject->wrapped()))
return;
- // Optimization: access _javascript_ global variables directly before involving the DOM.
- if (thisObject->JSGlobalObject::hasOwnPropertyForWrite(exec, Identifier::from(exec, index))) {
- JSGlobalObject::putByIndex(thisObject, exec, index, value, shouldThrow);
- return;
- }
-
Base::putByIndex(thisObject, exec, index, value, shouldThrow);
}