haikuwebkit/LayoutTests/js/cached-window-properties.html

39 lines
657 B
HTML
Raw Permalink Normal View History

replaceable own properties seem to ignore replacement after property caching https://bugs.webkit.org/show_bug.cgi?id=158091 Reviewed by Darin Adler. PerformanceTests: * MallocBench/MallocBench.xcodeproj/project.pbxproj: * MallocBench/MallocBench/Benchmark.cpp: * MallocBench/MallocBench/Interpreter.cpp: (Interpreter::doMallocOp): * MallocBench/MallocBench/Interpreter.h: * MallocBench/MallocBench/fastMallocLog.63316.ops: Added. * MallocBench/MallocBench/jetstream.cpp: Added. (benchmark_jetstream): * MallocBench/MallocBench/jetstream.h: Added. Source/JavaScriptCore: * runtime/Lookup.h: (JSC::replaceStaticPropertySlot): New helper function for replacing a static property with a direct property. We need to do an attribute changed transition because client code might have cached our static property. Source/WebCore: * bindings/scripts/CodeGeneratorJS.pm: (GenerateImplementation): Use our new replacement helper if we're replacing an own static property with an own direct property. Because we advertise that our own static properties are cacheable, we need to do a structure transition to indicate when they change. (Only own properties need this special treatment because JSC considers it normal to shadow a prototype property with an own property.) LayoutTests: * js/cached-window-properties.html: Augmneted this test to enter cacheable dictionary mode in order to demonstrate a bug that is not visible otherwise. Factored out a helper test function. Canonical link: https://commits.webkit.org/176231@main git-svn-id: https://svn.webkit.org/repository/webkit/trunk@201428 268f45cc-cd09-0410-ab3c-d52691b4dbfc
2016-05-26 19:51:26 +00:00
<!DOCTYPE HTML>
JSDOMWindow should not claim HasImpureGetOwnPropertySlot https://bugs.webkit.org/show_bug.cgi?id=132918 Reviewed by Geoffrey Garen. Source/JavaScriptCore: * jit/Repatch.cpp: (JSC::tryRepatchIn): We forgot to check for watchpoints when repatching "in". Source/WebCore: Tests: js/cached-window-properties.html js/cached-window-prototype-properties.html We now correctly handle the impurity of JSDOMWindow's custom getOwnPropertySlot without needing the blanket HasImpureGetOwnPropertySlot. We do this through the use of watchpoints and by explicitly forbidding any caching beyond a certain point using PropertySlot::disableCaching. Getting rid of this flag will allow us to cache many properties/methods on both the JSDOMWindow and its prototype, which are very commonly used across the web. * bindings/js/JSDOMWindowCustom.cpp: (WebCore::JSDOMWindow::getOwnPropertySlot): * bindings/scripts/CodeGeneratorJS.pm: (HasComplexGetOwnProperty): (InterfaceRequiresAttributesOnInstance): (InstanceOverridesGetOwnPropertySlot): (GenerateHeader): LayoutTests: We now correctly handle the impurity of JSDOMWindow's custom getOwnPropertySlot without needing the blanket HasImpureGetOwnPropertySlot. We do this through the use of watchpoints and by explicitly forbidding any caching beyond a certain point using PropertySlot::disableCaching. Getting rid of this flag will allow us to cache many properties/methods on both the JSDOMWindow and its prototype, which are very commonly used across the web. These tests trigger inline caching of window and window prototype properties. * js/cached-window-properties-expected.txt: Added. * js/cached-window-properties.html: Added. * js/cached-window-prototype-properties-expected.txt: Added. * js/cached-window-prototype-properties.html: Added. Canonical link: https://commits.webkit.org/151021@main git-svn-id: https://svn.webkit.org/repository/webkit/trunk@168914 268f45cc-cd09-0410-ab3c-d52691b4dbfc
2014-05-15 23:03:06 +00:00
<html>
<head>
<script src="../resources/js-test-pre.js"></script>
</head>
<body>
<script>
replaceable own properties seem to ignore replacement after property caching https://bugs.webkit.org/show_bug.cgi?id=158091 Reviewed by Darin Adler. PerformanceTests: * MallocBench/MallocBench.xcodeproj/project.pbxproj: * MallocBench/MallocBench/Benchmark.cpp: * MallocBench/MallocBench/Interpreter.cpp: (Interpreter::doMallocOp): * MallocBench/MallocBench/Interpreter.h: * MallocBench/MallocBench/fastMallocLog.63316.ops: Added. * MallocBench/MallocBench/jetstream.cpp: Added. (benchmark_jetstream): * MallocBench/MallocBench/jetstream.h: Added. Source/JavaScriptCore: * runtime/Lookup.h: (JSC::replaceStaticPropertySlot): New helper function for replacing a static property with a direct property. We need to do an attribute changed transition because client code might have cached our static property. Source/WebCore: * bindings/scripts/CodeGeneratorJS.pm: (GenerateImplementation): Use our new replacement helper if we're replacing an own static property with an own direct property. Because we advertise that our own static properties are cacheable, we need to do a structure transition to indicate when they change. (Only own properties need this special treatment because JSC considers it normal to shadow a prototype property with an own property.) LayoutTests: * js/cached-window-properties.html: Augmneted this test to enter cacheable dictionary mode in order to demonstrate a bug that is not visible otherwise. Factored out a helper test function. Canonical link: https://commits.webkit.org/176231@main git-svn-id: https://svn.webkit.org/repository/webkit/trunk@201428 268f45cc-cd09-0410-ab3c-d52691b4dbfc
2016-05-26 19:51:26 +00:00
// Force the window into cacheable dictionary mode.
for (var i = 0; i < 100; ++i)
window["p" + i] = i;
JSDOMWindow should not claim HasImpureGetOwnPropertySlot https://bugs.webkit.org/show_bug.cgi?id=132918 Reviewed by Geoffrey Garen. Source/JavaScriptCore: * jit/Repatch.cpp: (JSC::tryRepatchIn): We forgot to check for watchpoints when repatching "in". Source/WebCore: Tests: js/cached-window-properties.html js/cached-window-prototype-properties.html We now correctly handle the impurity of JSDOMWindow's custom getOwnPropertySlot without needing the blanket HasImpureGetOwnPropertySlot. We do this through the use of watchpoints and by explicitly forbidding any caching beyond a certain point using PropertySlot::disableCaching. Getting rid of this flag will allow us to cache many properties/methods on both the JSDOMWindow and its prototype, which are very commonly used across the web. * bindings/js/JSDOMWindowCustom.cpp: (WebCore::JSDOMWindow::getOwnPropertySlot): * bindings/scripts/CodeGeneratorJS.pm: (HasComplexGetOwnProperty): (InterfaceRequiresAttributesOnInstance): (InstanceOverridesGetOwnPropertySlot): (GenerateHeader): LayoutTests: We now correctly handle the impurity of JSDOMWindow's custom getOwnPropertySlot without needing the blanket HasImpureGetOwnPropertySlot. We do this through the use of watchpoints and by explicitly forbidding any caching beyond a certain point using PropertySlot::disableCaching. Getting rid of this flag will allow us to cache many properties/methods on both the JSDOMWindow and its prototype, which are very commonly used across the web. These tests trigger inline caching of window and window prototype properties. * js/cached-window-properties-expected.txt: Added. * js/cached-window-properties.html: Added. * js/cached-window-prototype-properties-expected.txt: Added. * js/cached-window-prototype-properties.html: Added. Canonical link: https://commits.webkit.org/151021@main git-svn-id: https://svn.webkit.org/repository/webkit/trunk@168914 268f45cc-cd09-0410-ab3c-d52691b4dbfc
2014-05-15 23:03:06 +00:00
var foo = function(o) {
return o.screenX;
};
replaceable own properties seem to ignore replacement after property caching https://bugs.webkit.org/show_bug.cgi?id=158091 Reviewed by Darin Adler. PerformanceTests: * MallocBench/MallocBench.xcodeproj/project.pbxproj: * MallocBench/MallocBench/Benchmark.cpp: * MallocBench/MallocBench/Interpreter.cpp: (Interpreter::doMallocOp): * MallocBench/MallocBench/Interpreter.h: * MallocBench/MallocBench/fastMallocLog.63316.ops: Added. * MallocBench/MallocBench/jetstream.cpp: Added. (benchmark_jetstream): * MallocBench/MallocBench/jetstream.h: Added. Source/JavaScriptCore: * runtime/Lookup.h: (JSC::replaceStaticPropertySlot): New helper function for replacing a static property with a direct property. We need to do an attribute changed transition because client code might have cached our static property. Source/WebCore: * bindings/scripts/CodeGeneratorJS.pm: (GenerateImplementation): Use our new replacement helper if we're replacing an own static property with an own direct property. Because we advertise that our own static properties are cacheable, we need to do a structure transition to indicate when they change. (Only own properties need this special treatment because JSC considers it normal to shadow a prototype property with an own property.) LayoutTests: * js/cached-window-properties.html: Augmneted this test to enter cacheable dictionary mode in order to demonstrate a bug that is not visible otherwise. Factored out a helper test function. Canonical link: https://commits.webkit.org/176231@main git-svn-id: https://svn.webkit.org/repository/webkit/trunk@201428 268f45cc-cd09-0410-ab3c-d52691b4dbfc
2016-05-26 19:51:26 +00:00
var test = function(id, x)
{
var niters = 100000;
JSDOMWindow should not claim HasImpureGetOwnPropertySlot https://bugs.webkit.org/show_bug.cgi?id=132918 Reviewed by Geoffrey Garen. Source/JavaScriptCore: * jit/Repatch.cpp: (JSC::tryRepatchIn): We forgot to check for watchpoints when repatching "in". Source/WebCore: Tests: js/cached-window-properties.html js/cached-window-prototype-properties.html We now correctly handle the impurity of JSDOMWindow's custom getOwnPropertySlot without needing the blanket HasImpureGetOwnPropertySlot. We do this through the use of watchpoints and by explicitly forbidding any caching beyond a certain point using PropertySlot::disableCaching. Getting rid of this flag will allow us to cache many properties/methods on both the JSDOMWindow and its prototype, which are very commonly used across the web. * bindings/js/JSDOMWindowCustom.cpp: (WebCore::JSDOMWindow::getOwnPropertySlot): * bindings/scripts/CodeGeneratorJS.pm: (HasComplexGetOwnProperty): (InterfaceRequiresAttributesOnInstance): (InstanceOverridesGetOwnPropertySlot): (GenerateHeader): LayoutTests: We now correctly handle the impurity of JSDOMWindow's custom getOwnPropertySlot without needing the blanket HasImpureGetOwnPropertySlot. We do this through the use of watchpoints and by explicitly forbidding any caching beyond a certain point using PropertySlot::disableCaching. Getting rid of this flag will allow us to cache many properties/methods on both the JSDOMWindow and its prototype, which are very commonly used across the web. These tests trigger inline caching of window and window prototype properties. * js/cached-window-properties-expected.txt: Added. * js/cached-window-properties.html: Added. * js/cached-window-prototype-properties-expected.txt: Added. * js/cached-window-prototype-properties.html: Added. Canonical link: https://commits.webkit.org/151021@main git-svn-id: https://svn.webkit.org/repository/webkit/trunk@168914 268f45cc-cd09-0410-ab3c-d52691b4dbfc
2014-05-15 23:03:06 +00:00
replaceable own properties seem to ignore replacement after property caching https://bugs.webkit.org/show_bug.cgi?id=158091 Reviewed by Darin Adler. PerformanceTests: * MallocBench/MallocBench.xcodeproj/project.pbxproj: * MallocBench/MallocBench/Benchmark.cpp: * MallocBench/MallocBench/Interpreter.cpp: (Interpreter::doMallocOp): * MallocBench/MallocBench/Interpreter.h: * MallocBench/MallocBench/fastMallocLog.63316.ops: Added. * MallocBench/MallocBench/jetstream.cpp: Added. (benchmark_jetstream): * MallocBench/MallocBench/jetstream.h: Added. Source/JavaScriptCore: * runtime/Lookup.h: (JSC::replaceStaticPropertySlot): New helper function for replacing a static property with a direct property. We need to do an attribute changed transition because client code might have cached our static property. Source/WebCore: * bindings/scripts/CodeGeneratorJS.pm: (GenerateImplementation): Use our new replacement helper if we're replacing an own static property with an own direct property. Because we advertise that our own static properties are cacheable, we need to do a structure transition to indicate when they change. (Only own properties need this special treatment because JSC considers it normal to shadow a prototype property with an own property.) LayoutTests: * js/cached-window-properties.html: Augmneted this test to enter cacheable dictionary mode in order to demonstrate a bug that is not visible otherwise. Factored out a helper test function. Canonical link: https://commits.webkit.org/176231@main git-svn-id: https://svn.webkit.org/repository/webkit/trunk@201428 268f45cc-cd09-0410-ab3c-d52691b4dbfc
2016-05-26 19:51:26 +00:00
var sum = 0;
for (var i = 0; i < niters; ++i)
sum += foo(window);
JSDOMWindow should not claim HasImpureGetOwnPropertySlot https://bugs.webkit.org/show_bug.cgi?id=132918 Reviewed by Geoffrey Garen. Source/JavaScriptCore: * jit/Repatch.cpp: (JSC::tryRepatchIn): We forgot to check for watchpoints when repatching "in". Source/WebCore: Tests: js/cached-window-properties.html js/cached-window-prototype-properties.html We now correctly handle the impurity of JSDOMWindow's custom getOwnPropertySlot without needing the blanket HasImpureGetOwnPropertySlot. We do this through the use of watchpoints and by explicitly forbidding any caching beyond a certain point using PropertySlot::disableCaching. Getting rid of this flag will allow us to cache many properties/methods on both the JSDOMWindow and its prototype, which are very commonly used across the web. * bindings/js/JSDOMWindowCustom.cpp: (WebCore::JSDOMWindow::getOwnPropertySlot): * bindings/scripts/CodeGeneratorJS.pm: (HasComplexGetOwnProperty): (InterfaceRequiresAttributesOnInstance): (InstanceOverridesGetOwnPropertySlot): (GenerateHeader): LayoutTests: We now correctly handle the impurity of JSDOMWindow's custom getOwnPropertySlot without needing the blanket HasImpureGetOwnPropertySlot. We do this through the use of watchpoints and by explicitly forbidding any caching beyond a certain point using PropertySlot::disableCaching. Getting rid of this flag will allow us to cache many properties/methods on both the JSDOMWindow and its prototype, which are very commonly used across the web. These tests trigger inline caching of window and window prototype properties. * js/cached-window-properties-expected.txt: Added. * js/cached-window-properties.html: Added. * js/cached-window-prototype-properties-expected.txt: Added. * js/cached-window-prototype-properties.html: Added. Canonical link: https://commits.webkit.org/151021@main git-svn-id: https://svn.webkit.org/repository/webkit/trunk@168914 268f45cc-cd09-0410-ab3c-d52691b4dbfc
2014-05-15 23:03:06 +00:00
replaceable own properties seem to ignore replacement after property caching https://bugs.webkit.org/show_bug.cgi?id=158091 Reviewed by Darin Adler. PerformanceTests: * MallocBench/MallocBench.xcodeproj/project.pbxproj: * MallocBench/MallocBench/Benchmark.cpp: * MallocBench/MallocBench/Interpreter.cpp: (Interpreter::doMallocOp): * MallocBench/MallocBench/Interpreter.h: * MallocBench/MallocBench/fastMallocLog.63316.ops: Added. * MallocBench/MallocBench/jetstream.cpp: Added. (benchmark_jetstream): * MallocBench/MallocBench/jetstream.h: Added. Source/JavaScriptCore: * runtime/Lookup.h: (JSC::replaceStaticPropertySlot): New helper function for replacing a static property with a direct property. We need to do an attribute changed transition because client code might have cached our static property. Source/WebCore: * bindings/scripts/CodeGeneratorJS.pm: (GenerateImplementation): Use our new replacement helper if we're replacing an own static property with an own direct property. Because we advertise that our own static properties are cacheable, we need to do a structure transition to indicate when they change. (Only own properties need this special treatment because JSC considers it normal to shadow a prototype property with an own property.) LayoutTests: * js/cached-window-properties.html: Augmneted this test to enter cacheable dictionary mode in order to demonstrate a bug that is not visible otherwise. Factored out a helper test function. Canonical link: https://commits.webkit.org/176231@main git-svn-id: https://svn.webkit.org/repository/webkit/trunk@201428 268f45cc-cd09-0410-ab3c-d52691b4dbfc
2016-05-26 19:51:26 +00:00
if (sum !== x * niters)
throw new Error("Incorrect sum for " + id);
JSDOMWindow should not claim HasImpureGetOwnPropertySlot https://bugs.webkit.org/show_bug.cgi?id=132918 Reviewed by Geoffrey Garen. Source/JavaScriptCore: * jit/Repatch.cpp: (JSC::tryRepatchIn): We forgot to check for watchpoints when repatching "in". Source/WebCore: Tests: js/cached-window-properties.html js/cached-window-prototype-properties.html We now correctly handle the impurity of JSDOMWindow's custom getOwnPropertySlot without needing the blanket HasImpureGetOwnPropertySlot. We do this through the use of watchpoints and by explicitly forbidding any caching beyond a certain point using PropertySlot::disableCaching. Getting rid of this flag will allow us to cache many properties/methods on both the JSDOMWindow and its prototype, which are very commonly used across the web. * bindings/js/JSDOMWindowCustom.cpp: (WebCore::JSDOMWindow::getOwnPropertySlot): * bindings/scripts/CodeGeneratorJS.pm: (HasComplexGetOwnProperty): (InterfaceRequiresAttributesOnInstance): (InstanceOverridesGetOwnPropertySlot): (GenerateHeader): LayoutTests: We now correctly handle the impurity of JSDOMWindow's custom getOwnPropertySlot without needing the blanket HasImpureGetOwnPropertySlot. We do this through the use of watchpoints and by explicitly forbidding any caching beyond a certain point using PropertySlot::disableCaching. Getting rid of this flag will allow us to cache many properties/methods on both the JSDOMWindow and its prototype, which are very commonly used across the web. These tests trigger inline caching of window and window prototype properties. * js/cached-window-properties-expected.txt: Added. * js/cached-window-properties.html: Added. * js/cached-window-prototype-properties-expected.txt: Added. * js/cached-window-prototype-properties.html: Added. Canonical link: https://commits.webkit.org/151021@main git-svn-id: https://svn.webkit.org/repository/webkit/trunk@168914 268f45cc-cd09-0410-ab3c-d52691b4dbfc
2014-05-15 23:03:06 +00:00
}
replaceable own properties seem to ignore replacement after property caching https://bugs.webkit.org/show_bug.cgi?id=158091 Reviewed by Darin Adler. PerformanceTests: * MallocBench/MallocBench.xcodeproj/project.pbxproj: * MallocBench/MallocBench/Benchmark.cpp: * MallocBench/MallocBench/Interpreter.cpp: (Interpreter::doMallocOp): * MallocBench/MallocBench/Interpreter.h: * MallocBench/MallocBench/fastMallocLog.63316.ops: Added. * MallocBench/MallocBench/jetstream.cpp: Added. (benchmark_jetstream): * MallocBench/MallocBench/jetstream.h: Added. Source/JavaScriptCore: * runtime/Lookup.h: (JSC::replaceStaticPropertySlot): New helper function for replacing a static property with a direct property. We need to do an attribute changed transition because client code might have cached our static property. Source/WebCore: * bindings/scripts/CodeGeneratorJS.pm: (GenerateImplementation): Use our new replacement helper if we're replacing an own static property with an own direct property. Because we advertise that our own static properties are cacheable, we need to do a structure transition to indicate when they change. (Only own properties need this special treatment because JSC considers it normal to shadow a prototype property with an own property.) LayoutTests: * js/cached-window-properties.html: Augmneted this test to enter cacheable dictionary mode in order to demonstrate a bug that is not visible otherwise. Factored out a helper test function. Canonical link: https://commits.webkit.org/176231@main git-svn-id: https://svn.webkit.org/repository/webkit/trunk@201428 268f45cc-cd09-0410-ab3c-d52691b4dbfc
2016-05-26 19:51:26 +00:00
var x = window.screenX;
test("x", x);
var newX = window.screenX + 1;
window.screenX = newX;
test("newX", newX);
JSDOMWindow should not claim HasImpureGetOwnPropertySlot https://bugs.webkit.org/show_bug.cgi?id=132918 Reviewed by Geoffrey Garen. Source/JavaScriptCore: * jit/Repatch.cpp: (JSC::tryRepatchIn): We forgot to check for watchpoints when repatching "in". Source/WebCore: Tests: js/cached-window-properties.html js/cached-window-prototype-properties.html We now correctly handle the impurity of JSDOMWindow's custom getOwnPropertySlot without needing the blanket HasImpureGetOwnPropertySlot. We do this through the use of watchpoints and by explicitly forbidding any caching beyond a certain point using PropertySlot::disableCaching. Getting rid of this flag will allow us to cache many properties/methods on both the JSDOMWindow and its prototype, which are very commonly used across the web. * bindings/js/JSDOMWindowCustom.cpp: (WebCore::JSDOMWindow::getOwnPropertySlot): * bindings/scripts/CodeGeneratorJS.pm: (HasComplexGetOwnProperty): (InterfaceRequiresAttributesOnInstance): (InstanceOverridesGetOwnPropertySlot): (GenerateHeader): LayoutTests: We now correctly handle the impurity of JSDOMWindow's custom getOwnPropertySlot without needing the blanket HasImpureGetOwnPropertySlot. We do this through the use of watchpoints and by explicitly forbidding any caching beyond a certain point using PropertySlot::disableCaching. Getting rid of this flag will allow us to cache many properties/methods on both the JSDOMWindow and its prototype, which are very commonly used across the web. These tests trigger inline caching of window and window prototype properties. * js/cached-window-properties-expected.txt: Added. * js/cached-window-properties.html: Added. * js/cached-window-prototype-properties-expected.txt: Added. * js/cached-window-prototype-properties.html: Added. Canonical link: https://commits.webkit.org/151021@main git-svn-id: https://svn.webkit.org/repository/webkit/trunk@168914 268f45cc-cd09-0410-ab3c-d52691b4dbfc
2014-05-15 23:03:06 +00:00
</script>
<script src="../resources/js-test-post.js"></script>
</body>
</html>