Permalink
Show file tree
Hide file tree
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Browse files
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
- Loading branch information
Mark Hahnenberg
committed
May 15, 2014
1 parent
e1d0049
commit c1ae3e2ac01f3b42c76c650763019ca824cde863
Showing
10 changed files
with
140 additions
and
12 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
@@ -0,0 +1,4 @@ | ||
PASS successfullyParsed is true | ||
|
||
TEST COMPLETE | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
@@ -0,0 +1,32 @@ | ||
<!DOCTYPE HTML PUBLIC "-//IETF//DTD HTML//EN"> | ||
<html> | ||
<head> | ||
<script src="../resources/js-test-pre.js"></script> | ||
</head> | ||
<body> | ||
<script> | ||
var foo = function(o) { | ||
return o.screenX; | ||
}; | ||
|
||
var x = window.screenX; | ||
var niters = 100000; | ||
var sum = 0; | ||
for (var i = 0; i < niters; ++i) { | ||
sum += foo(window); | ||
} | ||
if (sum !== x * niters) | ||
throw new Error("Incorrect sum"); | ||
|
||
window.screenX = 42; | ||
|
||
sum = 0; | ||
for (var i = 0; i < niters; ++i) { | ||
sum += foo(window); | ||
} | ||
if (sum !== 42 * niters) | ||
throw new Error("Incorrect sum"); | ||
</script> | ||
<script src="../resources/js-test-post.js"></script> | ||
</body> | ||
</html> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
@@ -0,0 +1,4 @@ | ||
PASS successfullyParsed is true | ||
|
||
TEST COMPLETE | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
@@ -0,0 +1,32 @@ | ||
<!DOCTYPE HTML PUBLIC "-//IETF//DTD HTML//EN"> | ||
<html> | ||
<head> | ||
<script src="../resources/js-test-pre.js"></script> | ||
</head> | ||
<body> | ||
<script> | ||
var foo = function(o) { | ||
return o.setTimeout; | ||
}; | ||
|
||
var realSetTimeout = window.setTimeout; | ||
var niters = 100000; | ||
for (var i = 0; i < niters; ++i) { | ||
if (foo(window) !== realSetTimeout) | ||
throw new Error("Incorrect setTimeout"); | ||
} | ||
|
||
var fakeSetTimeout = function() { | ||
return; | ||
}; | ||
|
||
window.setTimeout = fakeSetTimeout; | ||
|
||
for (var i = 0; i < niters; ++i) { | ||
if (foo(window) !== fakeSetTimeout) | ||
throw new Error("Incorrect setTimeout"); | ||
} | ||
</script> | ||
<script src="../resources/js-test-post.js"></script> | ||
</body> | ||
</html> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters