Unreviewed, rolling out r185889
authormmirman@apple.com <mmirman@apple.com@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Wed, 1 Jul 2015 23:28:51 +0000 (23:28 +0000)
committermmirman@apple.com <mmirman@apple.com@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Wed, 1 Jul 2015 23:28:51 +0000 (23:28 +0000)
https://bugs.webkit.org/show_bug.cgi?id=146528
rdar://problem/21573959

Patch breaks chromeexperiments.com

Reverted changeset:

Source/JavaScriptCore:

* CMakeLists.txt:
* JavaScriptCore.vcxproj/JavaScriptCore.vcxproj:
* JavaScriptCore.vcxproj/JavaScriptCore.vcxproj.filters:
* JavaScriptCore.xcodeproj/project.pbxproj:
* inspector/InjectedScriptSource.js:
(.):
* runtime/JSBoundSlotBaseFunction.cpp: Removed.
* runtime/JSBoundSlotBaseFunction.h: Removed.
* runtime/JSGlobalObject.cpp:
(JSC::JSGlobalObject::init): Deleted.
(JSC::JSGlobalObject::visitChildren): Deleted.
* runtime/JSGlobalObject.h:
(JSC::JSGlobalObject::boundSlotBaseFunctionStructure): Deleted.
* runtime/JSObject.cpp:
(JSC::JSObject::getOwnPropertyDescriptor):
(JSC::getBoundSlotBaseFunctionForGetterSetter): Deleted.
* runtime/VM.cpp:
(JSC::VM::VM): Deleted.
* runtime/VM.h:

LayoutTests:

* inspector-protocol/runtime/getProperties-expected.txt:
* js/dom/native-bindings-descriptors-expected.txt: Removed.
* js/dom/native-bindings-descriptors.html: Removed.
* js/dom/script-tests/native-bindings-descriptors.js: Removed.

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

18 files changed:
LayoutTests/ChangeLog
LayoutTests/inspector-protocol/runtime/getProperties-expected.txt
LayoutTests/js/dom/native-bindings-descriptors-expected.txt [deleted file]
LayoutTests/js/dom/native-bindings-descriptors.html [deleted file]
LayoutTests/js/dom/script-tests/native-bindings-descriptors.js [deleted file]
Source/JavaScriptCore/CMakeLists.txt
Source/JavaScriptCore/ChangeLog
Source/JavaScriptCore/JavaScriptCore.vcxproj/JavaScriptCore.vcxproj
Source/JavaScriptCore/JavaScriptCore.vcxproj/JavaScriptCore.vcxproj.filters
Source/JavaScriptCore/JavaScriptCore.xcodeproj/project.pbxproj
Source/JavaScriptCore/inspector/InjectedScriptSource.js
Source/JavaScriptCore/runtime/JSBoundSlotBaseFunction.cpp [deleted file]
Source/JavaScriptCore/runtime/JSBoundSlotBaseFunction.h [deleted file]
Source/JavaScriptCore/runtime/JSGlobalObject.cpp
Source/JavaScriptCore/runtime/JSGlobalObject.h
Source/JavaScriptCore/runtime/JSObject.cpp
Source/JavaScriptCore/runtime/VM.cpp
Source/JavaScriptCore/runtime/VM.h

index c27b1af..3d7a842 100644 (file)
@@ -1,3 +1,18 @@
+2015-07-01  Matthew Mirman  <mmirman@apple.com>
+
+        Unreviewed, rolling out r185889
+        https://bugs.webkit.org/show_bug.cgi?id=146528
+        rdar://problem/21573959
+
+        Patch breaks chromeexperiments.com
+        
+        Reverted changeset:
+        
+        * inspector-protocol/runtime/getProperties-expected.txt:
+        * js/dom/native-bindings-descriptors-expected.txt: Removed.
+        * js/dom/native-bindings-descriptors.html: Removed.
+        * js/dom/script-tests/native-bindings-descriptors.js: Removed.
+
 2015-07-01  Matthew Daiter  <mdaiter@apple.com>
 
         Turn off mediastreamaudiosourcenode.html test
index b89fc14..078d0da 100644 (file)
@@ -11,8 +11,8 @@ Properties of Bound function
   __proto__ function function () {
     [native code]
 }
-  arguments object TypeError: Type error
-  caller object TypeError: Type error
+  arguments
+  caller
   length number 0
   name string Number
 Internal properties
diff --git a/LayoutTests/js/dom/native-bindings-descriptors-expected.txt b/LayoutTests/js/dom/native-bindings-descriptors-expected.txt
deleted file mode 100644 (file)
index 5b18da7..0000000
+++ /dev/null
@@ -1,48 +0,0 @@
-CONSOLE MESSAGE: line 1: Deprecated attempt to access property 'title' on a non-Document object.
-CONSOLE MESSAGE: line 1: Deprecated attempt to access property 'title' on a non-Document object.
-CONSOLE MESSAGE: line 1: Deprecated attempt to access property 'title' on a non-Document object.
-CONSOLE MESSAGE: line 1: [object Object]
-CONSOLE MESSAGE: line 1: function nodeType() {
-    [native code]
-}
-document.title
-PASS Object.getOwnPropertyDescriptor(Document.prototype, 'title') is not Object.getOwnPropertyDescriptor(Document.prototype, 'title')
-PASS Object.getOwnPropertyDescriptor(Document.prototype, 'title').get is Object.getOwnPropertyDescriptor(Document.prototype, 'title').get
-PASS Object.getOwnPropertyDescriptor(Document.prototype, 'title').set is Object.getOwnPropertyDescriptor(Document.prototype, 'title').set
-PASS Object.getOwnPropertyDescriptor(Document.prototype, 'title').get.toString() is "function title() {\n    [native code]\n}"
-PASS Object.getOwnPropertyDescriptor(Document.prototype, 'title').get.length is 0
-PASS Object.getOwnPropertyDescriptor(Document.prototype, 'title').set.toString() is "function title() {\n    [native code]\n}"
-PASS Object.getOwnPropertyDescriptor(Document.prototype, 'title').set.length is 1
-PASS Object.getOwnPropertyDescriptor(Document.prototype, 'title').get.call(document) is document.title
-PASS document.title is "old title"
-PASS Object.getOwnPropertyDescriptor(Document.prototype, 'title').get.call(document) is "old title"
-PASS Object.getOwnPropertyDescriptor(Document.prototype, 'title').get.call() is undefined.
-PASS Object.getOwnPropertyDescriptor(Document.prototype, 'title').get.call(null) is undefined.
-PASS Object.getOwnPropertyDescriptor(Document.prototype, 'title').get.call(document.documentElement) is undefined.
-PASS Object.getOwnPropertyDescriptor(Document.prototype, 'title').set.call(document, 'new title') is undefined.
-PASS document.title is "new title"
-PASS Object.getOwnPropertyDescriptor(Document.prototype, 'title').get.call(document) is "new title"
-PASS Object.getOwnPropertyDescriptor(Document.prototype, 'title').set.call() threw exception TypeError: The Document.title setter can only be used on instances of Document.
-PASS Object.getOwnPropertyDescriptor(Document.prototype, 'title').set.call(null) threw exception TypeError: The Document.title setter can only be used on instances of Document.
-PASS Object.getOwnPropertyDescriptor(Document.prototype, 'title').set.call(document.documentElement) threw exception TypeError: The Document.title setter can only be used on instances of Document.
-
-document.readyState
-PASS Object.getOwnPropertyDescriptor(Document.prototype, 'readyState') is not Object.getOwnPropertyDescriptor(Document.prototype, 'readyState')
-PASS Object.getOwnPropertyDescriptor(Document.prototype, 'readyState').get is Object.getOwnPropertyDescriptor(Document.prototype, 'readyState').get
-PASS Object.getOwnPropertyDescriptor(Document.prototype, 'readyState').set is Object.getOwnPropertyDescriptor(Document.prototype, 'readyState').set
-PASS Object.getOwnPropertyDescriptor(Document.prototype, 'readyState').get.toString() is "function readyState() {\n    [native code]\n}"
-PASS Object.getOwnPropertyDescriptor(Document.prototype, 'readyState').get.length is 0
-PASS Object.getOwnPropertyDescriptor(Document.prototype, 'readyState').get.call(document) is document.readyState
-PASS Object.getOwnPropertyDescriptor(Document.prototype, 'readyState').set is undefined.
-
-Node.nodeType
-PASS console.log(node_type) did not throw exception.
-PASS console.log(getter) did not throw exception.
-PASS node_type.get is defined.
-PASS node_type.get.call(document.body) is 1
-PASS node_type.enumerable is true
-PASS getter === otherGetter is true
-PASS successfullyParsed is true
-
-TEST COMPLETE
-
diff --git a/LayoutTests/js/dom/native-bindings-descriptors.html b/LayoutTests/js/dom/native-bindings-descriptors.html
deleted file mode 100644 (file)
index 256202a..0000000
+++ /dev/null
@@ -1,11 +0,0 @@
-<!DOCTYPE HTML PUBLIC "-//IETF//DTD HTML//EN">
-<html>
-<head>
-<title>old title</title>
-<script src="../../resources/js-test-pre.js"></script>
-</head>
-<body>
-<script src="script-tests/native-bindings-descriptors.js"></script>
-<script src="../../resources/js-test-post.js"></script>
-</body>
-</html>
diff --git a/LayoutTests/js/dom/script-tests/native-bindings-descriptors.js b/LayoutTests/js/dom/script-tests/native-bindings-descriptors.js
deleted file mode 100644 (file)
index 79a537a..0000000
+++ /dev/null
@@ -1,54 +0,0 @@
-debug("document.title");
-shouldNotBe("Object.getOwnPropertyDescriptor(Document.prototype, 'title')", "Object.getOwnPropertyDescriptor(Document.prototype, 'title')");
-shouldBe("Object.getOwnPropertyDescriptor(Document.prototype, 'title').get", "Object.getOwnPropertyDescriptor(Document.prototype, 'title').get");
-shouldBe("Object.getOwnPropertyDescriptor(Document.prototype, 'title').set", "Object.getOwnPropertyDescriptor(Document.prototype, 'title').set");
-shouldBeEqualToString("Object.getOwnPropertyDescriptor(Document.prototype, 'title').get.toString()", "function title() {\n    [native code]\n}");
-shouldBe("Object.getOwnPropertyDescriptor(Document.prototype, 'title').get.length", "0");
-shouldBeEqualToString("Object.getOwnPropertyDescriptor(Document.prototype, 'title').set.toString()", "function title() {\n    [native code]\n}");
-shouldBe("Object.getOwnPropertyDescriptor(Document.prototype, 'title').set.length", "1");
-shouldBe("Object.getOwnPropertyDescriptor(Document.prototype, 'title').get.call(document)", "document.title");
-shouldBeEqualToString('document.title', 'old title');
-shouldBeEqualToString("Object.getOwnPropertyDescriptor(Document.prototype, 'title').get.call(document)", 'old title');
-shouldBeUndefined("Object.getOwnPropertyDescriptor(Document.prototype, 'title').get.call()");
-shouldBeUndefined("Object.getOwnPropertyDescriptor(Document.prototype, 'title').get.call(null)");
-shouldBeUndefined("Object.getOwnPropertyDescriptor(Document.prototype, 'title').get.call(document.documentElement)");
-shouldBeUndefined("Object.getOwnPropertyDescriptor(Document.prototype, 'title').set.call(document, 'new title')");
-shouldBeEqualToString('document.title', 'new title');
-shouldBeEqualToString("Object.getOwnPropertyDescriptor(Document.prototype, 'title').get.call(document)", 'new title');
-shouldThrow("Object.getOwnPropertyDescriptor(Document.prototype, 'title').set.call()");
-shouldThrow("Object.getOwnPropertyDescriptor(Document.prototype, 'title').set.call(null)");
-shouldThrow("Object.getOwnPropertyDescriptor(Document.prototype, 'title').set.call(document.documentElement)");
-
-// document.readyState CustomAccessor: getter
-// readonly attribute DOMString readyState;
-debug("");
-debug("document.readyState");
-shouldNotBe("Object.getOwnPropertyDescriptor(Document.prototype, 'readyState')", "Object.getOwnPropertyDescriptor(Document.prototype, 'readyState')");
-shouldBe("Object.getOwnPropertyDescriptor(Document.prototype, 'readyState').get", "Object.getOwnPropertyDescriptor(Document.prototype, 'readyState').get");
-shouldBe("Object.getOwnPropertyDescriptor(Document.prototype, 'readyState').set", "Object.getOwnPropertyDescriptor(Document.prototype, 'readyState').set");
-shouldBeEqualToString("Object.getOwnPropertyDescriptor(Document.prototype, 'readyState').get.toString()", "function readyState() {\n    [native code]\n}");
-shouldBe("Object.getOwnPropertyDescriptor(Document.prototype, 'readyState').get.length", "0");
-shouldBe("Object.getOwnPropertyDescriptor(Document.prototype, 'readyState').get.call(document)", "document.readyState");
-shouldBeUndefined("Object.getOwnPropertyDescriptor(Document.prototype, 'readyState').set");
-
-
-debug("");
-debug("Node.nodeType");
-
-var node_type = Object.getOwnPropertyDescriptor(Node.prototype, 'nodeType');
-
-// tests that logging one of these to the console does not cause a crash or throw an exception.
-shouldNotThrow("console.log(node_type)");
-
-var getter = node_type.get;
-shouldNotThrow("console.log(getter)");
-
-shouldBeDefined("node_type.get");
-shouldBe("node_type.get.call(document.body)", "1");
-shouldBeTrue("node_type.enumerable");
-
-
-
-// tests that the getter on native descriptors is always the same under strict equality. 
-var otherGetter = Object.getOwnPropertyDescriptor(Node.prototype, 'nodeType').get;
-shouldBeTrue("getter === otherGetter");
index 30e0177..011624c 100644 (file)
@@ -476,7 +476,6 @@ set(JavaScriptCore_RUNTIME_SOURCES
     runtime/IteratorOperations.cpp
     runtime/IteratorPrototype.cpp
     runtime/JSAPIValueWrapper.cpp
-    runtime/JSBoundSlotBaseFunction.cpp
     runtime/JSArray.cpp
     runtime/JSArrayBuffer.cpp
     runtime/JSArrayBufferConstructor.cpp
index 7170007..99f306c 100644 (file)
@@ -1,3 +1,33 @@
+2015-07-01  Matthew Mirman  <mmirman@apple.com>
+
+        Unreviewed, rolling out r185889
+        https://bugs.webkit.org/show_bug.cgi?id=146528
+        rdar://problem/21573959
+
+        Patch breaks chromeexperiments.com
+        
+        Reverted changeset:
+        
+        * CMakeLists.txt:
+        * JavaScriptCore.vcxproj/JavaScriptCore.vcxproj:
+        * JavaScriptCore.vcxproj/JavaScriptCore.vcxproj.filters:
+        * JavaScriptCore.xcodeproj/project.pbxproj:
+        * inspector/InjectedScriptSource.js:
+        (.):
+        * runtime/JSBoundSlotBaseFunction.cpp: Removed.
+        * runtime/JSBoundSlotBaseFunction.h: Removed.
+        * runtime/JSGlobalObject.cpp:
+        (JSC::JSGlobalObject::init): Deleted.
+        (JSC::JSGlobalObject::visitChildren): Deleted.
+        * runtime/JSGlobalObject.h:
+        (JSC::JSGlobalObject::boundSlotBaseFunctionStructure): Deleted.
+        * runtime/JSObject.cpp:
+        (JSC::JSObject::getOwnPropertyDescriptor):
+        (JSC::getBoundSlotBaseFunctionForGetterSetter): Deleted.
+        * runtime/VM.cpp:
+        (JSC::VM::VM): Deleted.
+        * runtime/VM.h:
+
 2015-07-01  Dean Jackson  <dino@apple.com>
 
         Disable the experimental WebGL2 implementation
index 9738407..7162254 100644 (file)
     <ClCompile Include="..\runtime\JSArrayBufferPrototype.cpp" />
     <ClCompile Include="..\runtime\JSArrayBufferView.cpp" />
     <ClCompile Include="..\runtime\JSBoundFunction.cpp" />
-    <ClCompile Include="..\runtime\JSBoundSlotBaseFunction.cpp" />
     <ClCompile Include="..\runtime\JSCJSValue.cpp" />
     <ClCompile Include="..\runtime\JSCallee.cpp" />
     <ClCompile Include="..\runtime\JSCatchScope.cpp" />
     <ClInclude Include="..\runtime\JSArrayBufferViewInlines.h" />
     <ClInclude Include="..\runtime\JSArrayIterator.h" />
     <ClInclude Include="..\runtime\JSBoundFunction.h" />
-    <ClInclude Include="..\runtime\JSBoundSlotBaseFunction.h" />
     <ClInclude Include="..\runtime\JSCInlines.h" />
     <ClInclude Include="..\runtime\JSCJSValue.h" />
     <ClInclude Include="..\runtime\JSCJSValueInlines.h" />
index 82b51b0..4de16e7 100644 (file)
     <ClCompile Include="..\runtime\JSBoundFunction.cpp">
       <Filter>runtime</Filter>
     </ClCompile>
-    <ClCompile Include="..\runtime\JSBoundSlotBaseFunction.cpp">
-      <Filter>runtime</Filter>
-    </ClCompile>
     <ClCompile Include="..\runtime\JSCallee.cpp">
       <Filter>runtime</Filter>
     </ClCompile>
     <ClInclude Include="..\runtime\JSBoundFunction.h">
       <Filter>runtime</Filter>
     </ClInclude>
-    <ClInclude Include="..\runtime\JSBoundSlotBaseFunction.h">
-      <Filter>runtime</Filter>
-    </ClInclude>
     <ClInclude Include="..\runtime\JSCallee.h">
       <Filter>runtime</Filter>
     </ClInclude>
index 4b356f6..b544334 100644 (file)
                A5FD0082189B191A00633231 /* InspectorConsoleAgent.h in Headers */ = {isa = PBXBuildFile; fileRef = A5FD0080189B191A00633231 /* InspectorConsoleAgent.h */; settings = {ATTRIBUTES = (Private, ); }; };
                A5FD0085189B1B7E00633231 /* JSGlobalObjectConsoleAgent.cpp in Sources */ = {isa = PBXBuildFile; fileRef = A5FD0083189B1B7E00633231 /* JSGlobalObjectConsoleAgent.cpp */; };
                A5FD0086189B1B7E00633231 /* JSGlobalObjectConsoleAgent.h in Headers */ = {isa = PBXBuildFile; fileRef = A5FD0084189B1B7E00633231 /* JSGlobalObjectConsoleAgent.h */; };
-               A6738B041B2BB37D00027B28 /* JSBoundSlotBaseFunction.h in Headers */ = {isa = PBXBuildFile; fileRef = A6738B031B2BB36C00027B28 /* JSBoundSlotBaseFunction.h */; };
-               A6738B051B2BB39600027B28 /* JSBoundSlotBaseFunction.cpp in Sources */ = {isa = PBXBuildFile; fileRef = A6738B021B2BB36C00027B28 /* JSBoundSlotBaseFunction.cpp */; };
                A700873917CBE85300C3E643 /* MapConstructor.cpp in Sources */ = {isa = PBXBuildFile; fileRef = A700873717CBE85300C3E643 /* MapConstructor.cpp */; };
                A700873A17CBE85300C3E643 /* MapConstructor.h in Headers */ = {isa = PBXBuildFile; fileRef = A700873817CBE85300C3E643 /* MapConstructor.h */; };
                A700873D17CBE8D300C3E643 /* MapPrototype.cpp in Sources */ = {isa = PBXBuildFile; fileRef = A700873B17CBE8D300C3E643 /* MapPrototype.cpp */; };
                A5FD0080189B191A00633231 /* InspectorConsoleAgent.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = InspectorConsoleAgent.h; sourceTree = "<group>"; };
                A5FD0083189B1B7E00633231 /* JSGlobalObjectConsoleAgent.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = JSGlobalObjectConsoleAgent.cpp; sourceTree = "<group>"; };
                A5FD0084189B1B7E00633231 /* JSGlobalObjectConsoleAgent.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = JSGlobalObjectConsoleAgent.h; sourceTree = "<group>"; };
-               A6738B021B2BB36C00027B28 /* JSBoundSlotBaseFunction.cpp */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.cpp.cpp; path = JSBoundSlotBaseFunction.cpp; sourceTree = "<group>"; };
-               A6738B031B2BB36C00027B28 /* JSBoundSlotBaseFunction.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = JSBoundSlotBaseFunction.h; sourceTree = "<group>"; };
                A700873717CBE85300C3E643 /* MapConstructor.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = MapConstructor.cpp; sourceTree = "<group>"; };
                A700873817CBE85300C3E643 /* MapConstructor.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = MapConstructor.h; sourceTree = "<group>"; };
                A700873B17CBE8D300C3E643 /* MapPrototype.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = MapPrototype.cpp; sourceTree = "<group>"; };
                7EF6E0BB0EB7A1EC0079AFAF /* runtime */ = {
                        isa = PBXGroup;
                        children = (
-                               A6738B021B2BB36C00027B28 /* JSBoundSlotBaseFunction.cpp */,
-                               A6738B031B2BB36C00027B28 /* JSBoundSlotBaseFunction.h */,
                                BCF605110E203EF800B9A64D /* ArgList.cpp */,
                                BCF605120E203EF800B9A64D /* ArgList.h */,
                                0FE0500C1AA9091100D33B33 /* ArgumentsMode.h */,
                                A503FA22188EFF6800110F14 /* ScriptDebugListener.h in Headers */,
                                A503FA26188EFFFD00110F14 /* ScriptDebugServer.h in Headers */,
                                A55D93A6185012A800400DED /* ScriptFunctionCall.h in Headers */,
-                               A6738B041B2BB37D00027B28 /* JSBoundSlotBaseFunction.h in Headers */,
                                A54CF2FA184EAEDA00237F19 /* ScriptObject.h in Headers */,
                                A54CF2F6184EAB2400237F19 /* ScriptValue.h in Headers */,
                                A7299DA617D12858005F5FF9 /* SetConstructor.h in Headers */,
                        isa = PBXSourcesBuildPhase;
                        buildActionMask = 2147483647;
                        files = (
-                               A6738B051B2BB39600027B28 /* JSBoundSlotBaseFunction.cpp in Sources */,
                                9EA5C7A2190F088700508EBE /* InitializeLLVMMac.cpp in Sources */,
                                9EA5C7A1190F084200508EBE /* BundlePath.mm in Sources */,
                                52B310FF1975B4240080857C /* TypeLocationCache.cpp in Sources */,
index 2b30f9d..e576139 100644 (file)
@@ -54,14 +54,6 @@ function isUInt32(obj)
     return "" + (obj >>> 0) === obj;
 }
 
-function endsWith(str, suffix)
-{
-    var position = str.length - suffix.length;
-    if (position < 0)
-        return false;
-    return str.indexOf(suffix, position) === position;
-}
-
 function isSymbol(obj)
 {
     return typeof obj === "symbol";
@@ -688,10 +680,8 @@ InjectedScript.prototype = {
                     continue;
                 }
 
-                if (endsWith(String(descriptor.get), "[native code]\n}") || 
-                     (!descriptor.get && descriptor.hasOwnProperty("get") && !descriptor.set && descriptor.hasOwnProperty("set"))) {
-                    // FIXME: Some Native Bindings Descriptors are Incomplete
-                    // <https://webkit.org/b/141585> Some IDL attributes appear on the instances instead of on prototypes
+                if (descriptor.hasOwnProperty("get") && descriptor.hasOwnProperty("set") && !descriptor.get && !descriptor.set) {
+                    // FIXME: <https://webkit.org/b/140575> Web Inspector: Native Bindings Descriptors are Incomplete
                     // Developers may create such a descriptors, so we should be resilient:
                     // var x = {}; Object.defineProperty(x, "p", {get:undefined}); Object.getOwnPropertyDescriptor(x, "p")
                     var fakeDescriptor = createFakeValueDescriptor(name, symbol, descriptor, isOwnProperty, true);
diff --git a/Source/JavaScriptCore/runtime/JSBoundSlotBaseFunction.cpp b/Source/JavaScriptCore/runtime/JSBoundSlotBaseFunction.cpp
deleted file mode 100644 (file)
index 1e20d09..0000000
+++ /dev/null
@@ -1,94 +0,0 @@
-/*
- * Copyright (C) 2015 Apple Inc. All rights reserved.
- *
- * Redistribution and use in source and binary forms, with or without
- * modification, are permitted provided that the following conditions
- * are met:
- * 1. Redistributions of source code must retain the above copyright
- *    notice, this list of conditions and the following disclaimer.
- * 2. Redistributions in binary form must reproduce the above copyright
- *    notice, this list of conditions and the following disclaimer in the
- *    documentation and/or other materials provided with the distribution.
- *
- * THIS SOFTWARE IS PROVIDED BY APPLE INC. ``AS IS'' AND ANY
- * EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
- * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
- * PURPOSE ARE DISCLAIMED.  IN NO EVENT SHALL APPLE INC. OR
- * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL,
- * EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO,
- * PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR
- * PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY
- * OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
- * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
- * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. 
- */
-
-#include "config.h"
-#include "JSBoundSlotBaseFunction.h"
-
-#include "CustomGetterSetter.h"
-#include "GetterSetter.h"
-#include "JSCInlines.h"
-#include "JSGlobalObject.h"
-
-namespace JSC {
-
-const ClassInfo JSBoundSlotBaseFunction::s_info = { "Function", &Base::s_info, 0, CREATE_METHOD_TABLE(JSBoundSlotBaseFunction) };
-
-EncodedJSValue JSC_HOST_CALL boundSlotBaseFunctionCall(ExecState* exec)
-{
-    JSBoundSlotBaseFunction* boundSlotBaseFunction = jsCast<JSBoundSlotBaseFunction*>(exec->callee());
-    JSObject* baseObject = boundSlotBaseFunction->boundSlotBase();
-    CustomGetterSetter* customGetterSetter = boundSlotBaseFunction->customGetterSetter();
-
-    if (boundSlotBaseFunction->isSetter()) {
-        callCustomSetter(exec, customGetterSetter, baseObject, exec->thisValue(), exec->argument(0));
-        return JSValue::encode(jsUndefined());
-    }
-
-    CustomGetterSetter::CustomGetter getter = customGetterSetter->getter();
-    if (!getter)
-        return JSValue::encode(jsUndefined());
-
-    const String& name = boundSlotBaseFunction->name(exec);
-    return getter(exec, baseObject, JSValue::encode(exec->thisValue()), PropertyName(Identifier::fromString(exec, name)));
-}
-
-JSBoundSlotBaseFunction::JSBoundSlotBaseFunction(VM& vm, JSGlobalObject* globalObject, Structure* structure, const Type type)
-    : Base(vm, globalObject, structure)
-    , m_type(type)
-{
-}
-
-JSBoundSlotBaseFunction* JSBoundSlotBaseFunction::create(VM& vm, JSGlobalObject* globalObject, JSObject* boundSlotBase, CustomGetterSetter* getterSetter, const Type type, const String& name)
-{
-    NativeExecutable* executable = vm.getHostFunction(boundSlotBaseFunctionCall, callHostFunctionAsConstructor);
-
-    JSBoundSlotBaseFunction* function = new (NotNull, allocateCell<JSBoundSlotBaseFunction>(vm.heap)) JSBoundSlotBaseFunction(vm, globalObject, globalObject->boundSlotBaseFunctionStructure(), type);
-
-    // Can't do this during initialization because getHostFunction might do a GC allocation.
-    function->finishCreation(vm, executable, boundSlotBase, getterSetter, name);
-    return function;
-}
-
-void JSBoundSlotBaseFunction::visitChildren(JSCell* cell, SlotVisitor& visitor)
-{
-    JSBoundSlotBaseFunction* thisObject = jsCast<JSBoundSlotBaseFunction*>(cell);
-    ASSERT_GC_OBJECT_INHERITS(thisObject, info());
-    Base::visitChildren(thisObject, visitor);
-
-    visitor.append(&thisObject->m_boundSlotBase);
-    visitor.append(&thisObject->m_getterSetter);
-}
-
-void JSBoundSlotBaseFunction::finishCreation(VM& vm, NativeExecutable* executable, JSObject* boundSlotBase, CustomGetterSetter* getterSetter, const String& name)
-{
-    Base::finishCreation(vm, executable, isSetter(), name);
-    ASSERT(inherits(info()));
-    ASSERT(boundSlotBase);
-    ASSERT(getterSetter);
-    m_boundSlotBase.set(vm, this, boundSlotBase);
-    m_getterSetter.set(vm, this, getterSetter);
-}
-
-} // namespace JSC
diff --git a/Source/JavaScriptCore/runtime/JSBoundSlotBaseFunction.h b/Source/JavaScriptCore/runtime/JSBoundSlotBaseFunction.h
deleted file mode 100644 (file)
index a8dcc33..0000000
+++ /dev/null
@@ -1,78 +0,0 @@
-/*
- * Copyright (C) 2015 Apple Inc. All rights reserved.
- *
- * Redistribution and use in source and binary forms, with or without
- * modification, are permitted provided that the following conditions
- * are met:
- * 1. Redistributions of source code must retain the above copyright
- *    notice, this list of conditions and the following disclaimer.
- * 2. Redistributions in binary form must reproduce the above copyright
- *    notice, this list of conditions and the following disclaimer in the
- *    documentation and/or other materials provided with the distribution.
- *
- * THIS SOFTWARE IS PROVIDED BY APPLE INC. ``AS IS'' AND ANY
- * EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
- * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
- * PURPOSE ARE DISCLAIMED.  IN NO EVENT SHALL APPLE INC. OR
- * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL,
- * EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO,
- * PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR
- * PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY
- * OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
- * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
- * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. 
- */
-
-#ifndef JSBoundSlotBaseFunction_h
-#define JSBoundSlotBaseFunction_h
-
-#include "JSFunction.h"
-
-namespace JSC {
-
-class CustomGetterSetter;
-
-EncodedJSValue JSC_HOST_CALL boundSlotBaseFunctionCall(ExecState*);
-
-class JSBoundSlotBaseFunction : public JSFunction {
-
-public:
-
-    typedef JSFunction Base;
-
-    // The Type is set to the number of arguments the resultant function will have.
-    enum class Type { Getter = 0, Setter = 1 };
-
-    static const unsigned StructureFlags = Base::StructureFlags;
-
-    static Structure* createStructure(VM& vm, JSGlobalObject* globalObject, JSValue prototype)
-    {
-        ASSERT(globalObject);
-        return Structure::create(vm, globalObject, prototype, TypeInfo(JSFunctionType, StructureFlags), info()); 
-    }
-
-    static JSBoundSlotBaseFunction* create(VM&, JSGlobalObject*, JSObject*, CustomGetterSetter*, const Type, const String&);
-
-    JSObject* boundSlotBase() const { return m_boundSlotBase.get(); }
-    CustomGetterSetter* customGetterSetter() const { return m_getterSetter.get(); }
-    bool isSetter() const { return m_type == Type::Setter; }
-
-    DECLARE_EXPORT_INFO;
-
-protected:
-
-    static void visitChildren(JSCell*, SlotVisitor&);
-
-private:
-
-    JSBoundSlotBaseFunction(VM&, JSGlobalObject*, Structure*, Type);
-
-    void finishCreation(VM&, NativeExecutable*, JSObject*, CustomGetterSetter*, const String&);
-
-    WriteBarrier<JSObject> m_boundSlotBase;
-    WriteBarrier<CustomGetterSetter> m_getterSetter;
-    Type m_type;
-};
-} // namespace JSC
-
-#endif // JSBoundSlotBaseFunction_h
index a0578ec..43c82d5 100644 (file)
@@ -60,7 +60,6 @@
 #include "JSArrayBufferPrototype.h"
 #include "JSArrayIterator.h"
 #include "JSBoundFunction.h"
-#include "JSBoundSlotBaseFunction.h"
 #include "JSCInlines.h"
 #include "JSCallbackConstructor.h"
 #include "JSCallbackFunction.h"
@@ -246,7 +245,6 @@ void JSGlobalObject::init(VM& vm)
     exec->setCallee(m_globalCallee.get());
 
     m_functionStructure.set(vm, this, JSFunction::createStructure(vm, this, m_functionPrototype.get()));
-    m_boundSlotBaseFunctionStructure.set(vm, this, JSBoundSlotBaseFunction::createStructure(vm, this, m_functionPrototype.get()));
     m_boundFunctionStructure.set(vm, this, JSBoundFunction::createStructure(vm, this, m_functionPrototype.get()));
     m_namedFunctionStructure.set(vm, this, Structure::addPropertyTransition(vm, m_functionStructure.get(), vm.propertyNames->name, DontDelete | ReadOnly | DontEnum, m_functionNameOffset));
     m_internalFunctionStructure.set(vm, this, InternalFunction::createStructure(vm, this, m_functionPrototype.get()));
@@ -784,7 +782,6 @@ void JSGlobalObject::visitChildren(JSCell* cell, SlotVisitor& visitor)
     visitor.append(&thisObject->m_errorStructure);
     visitor.append(&thisObject->m_calleeStructure);
     visitor.append(&thisObject->m_functionStructure);
-    visitor.append(&thisObject->m_boundSlotBaseFunctionStructure);
     visitor.append(&thisObject->m_boundFunctionStructure);
     visitor.append(&thisObject->m_namedFunctionStructure);
     visitor.append(&thisObject->m_symbolObjectStructure);
index 9f5c6e8..9b0e7ba 100644 (file)
@@ -238,7 +238,6 @@ protected:
     WriteBarrier<Structure> m_calleeStructure;
     WriteBarrier<Structure> m_functionStructure;
     WriteBarrier<Structure> m_boundFunctionStructure;
-    WriteBarrier<Structure> m_boundSlotBaseFunctionStructure;
     WriteBarrier<Structure> m_namedFunctionStructure;
     PropertyOffset m_functionNameOffset;
     WriteBarrier<Structure> m_privateNameStructure;
@@ -479,7 +478,6 @@ public:
     Structure* calleeStructure() const { return m_calleeStructure.get(); }
     Structure* functionStructure() const { return m_functionStructure.get(); }
     Structure* boundFunctionStructure() const { return m_boundFunctionStructure.get(); }
-    Structure* boundSlotBaseFunctionStructure() const { return m_boundSlotBaseFunctionStructure.get(); }
     Structure* namedFunctionStructure() const { return m_namedFunctionStructure.get(); }
     PropertyOffset functionNameOffset() const { return m_functionNameOffset; }
     Structure* numberObjectStructure() const { return m_numberObjectStructure.get(); }
index 67fd962..faece30 100644 (file)
@@ -35,7 +35,6 @@
 #include "Executable.h"
 #include "GetterSetter.h"
 #include "IndexingHeaderInlines.h"
-#include "JSBoundSlotBaseFunction.h"
 #include "JSCatchScope.h"
 #include "JSFunction.h"
 #include "JSFunctionNameScope.h"
@@ -2489,17 +2488,6 @@ Butterfly* JSObject::growOutOfLineStorage(VM& vm, size_t oldSize, size_t newSize
     return Butterfly::createOrGrowPropertyStorage(m_butterfly.get(), vm, this, structure(vm), oldSize, newSize);
 }
 
-static JSBoundSlotBaseFunction* getBoundSlotBaseFunctionForGetterSetter(ExecState* exec, PropertyName propertyName, JSC::PropertySlot& slot, CustomGetterSetter* getterSetter, JSBoundSlotBaseFunction::Type type)
-{
-    auto key = std::make_pair(getterSetter, (int)type);
-    JSBoundSlotBaseFunction* boundSlotBase = exec->vm().customGetterSetterFunctionMap.get(key);
-    if (!boundSlotBase) {
-        boundSlotBase = JSBoundSlotBaseFunction::create(exec->vm(), exec->lexicalGlobalObject(), slot.slotBase(), getterSetter, type, propertyName.publicName());
-        exec->vm().customGetterSetterFunctionMap.set(key, boundSlotBase);
-    }
-    return boundSlotBase;
-}
-
 bool JSObject::getOwnPropertyDescriptor(ExecState* exec, PropertyName propertyName, PropertyDescriptor& descriptor)
 {
     JSC::PropertySlot slot(this);
@@ -2510,22 +2498,9 @@ bool JSObject::getOwnPropertyDescriptor(ExecState* exec, PropertyName propertyNa
         return false;
     if (slot.isAccessor())
         descriptor.setAccessorDescriptor(slot.getterSetter(), slot.attributes());
-    else if (slot.attributes() & CustomAccessor) {
+    else if (slot.attributes() & CustomAccessor)
         descriptor.setCustomDescriptor(slot.attributes());
-        
-        JSValue maybeGetterSetter = getDirect(exec->vm(), propertyName);
-        if (maybeGetterSetter) {
-
-            CustomGetterSetter* getterSetter = jsCast<CustomGetterSetter*>(maybeGetterSetter);
-            ASSERT(getterSetter);
-
-            if (getterSetter->getter())
-                descriptor.setGetter(getBoundSlotBaseFunctionForGetterSetter(exec, propertyName, slot, getterSetter, JSBoundSlotBaseFunction::Type::Getter));
-            if (getterSetter->setter())
-                descriptor.setSetter(getBoundSlotBaseFunctionForGetterSetter(exec, propertyName, slot, getterSetter, JSBoundSlotBaseFunction::Type::Setter));
-            descriptor.setEnumerable(true);
-        }
-    } else
+    else
         descriptor.setDescriptor(slot.getValue(exec, propertyName), slot.attributes());
     return true;
 }
index e366a6e..7d9df80 100644 (file)
@@ -152,7 +152,6 @@ VM::VM(VMType vmType, HeapType heapType)
     , m_atomicStringTable(vmType == Default ? wtfThreadData().atomicStringTable() : new AtomicStringTable)
     , propertyNames(nullptr)
     , emptyList(new MarkedArgumentBuffer)
-    , customGetterSetterFunctionMap(*this)
     , stringCache(*this)
     , prototypeMap(*this)
     , keywords(std::make_unique<Keywords>(*this))
index aa81a89..bfc4f4a 100644 (file)
@@ -76,7 +76,6 @@ class BuiltinExecutables;
 class CodeBlock;
 class CodeCache;
 class CommonIdentifiers;
-class CustomGetterSetter;
 class ExecState;
 class Exception;
 class HandleStack;
@@ -84,7 +83,6 @@ class TypeProfiler;
 class TypeProfilerLog;
 class Identifier;
 class Interpreter;
-class JSBoundSlotBaseFunction;
 class JSGlobalObject;
 class JSObject;
 class Keywords;
@@ -292,7 +290,6 @@ public:
     NumericStrings numericStrings;
     DateInstanceCache dateInstanceCache;
     WTF::SimpleStats machineCodeBytesPerBytecodeWordForBaselineJIT;
-    WeakGCMap<std::pair<CustomGetterSetter*, int>, JSBoundSlotBaseFunction> customGetterSetterFunctionMap;
     WeakGCMap<StringImpl*, JSString, PtrHash<StringImpl*>> stringCache;
     Strong<JSString> lastCachedString;