Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge r176676 - Fixes inline cache fast path accessing nonexistant ge…
…tters. <rdar://problem/18416918> https://bugs.webkit.org/show_bug.cgi?id=136961 Reviewed by Filip Pizlo. Fixes a bug in inline caching where getters would have been able to modify the property they are getting during building the inline cache and then accessing that property through the inline cache site causing a recursive inline cache building and allowing the fast path of the cache to try to load a getter for the property that no longer exists. * jit/JITOperations.cpp: Switched use of get to getPropertySlot. * runtime/JSCJSValue.h: added getPropertySlot for when you don't want to perform the get quite yet but want to fill out the slot. * runtime/JSCJSValueInlines.h: Added implementation for getPropertySlot (JSC::JSValue::get): changed to simply call getPropertySlot (JSC::JSValue::getPropertySlot): added. * tests/stress/recursive_property_redefine_during_inline_caching.js: Added test case for bug. (test): Canonical link: https://commits.webkit.org/154760.247@webkitgtk/2.6 git-svn-id: https://svn.webkit.org/repository/webkit/releases/WebKitGTK/webkit-2.6@178286 268f45cc-cd09-0410-ab3c-d52691b4dbfc
- Loading branch information
1 parent
dc4daef
commit cbba445
Showing
5 changed files
with
66 additions
and
14 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
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
23 changes: 23 additions & 0 deletions
23
Source/JavaScriptCore/tests/stress/recursive_property_redefine_during_inline_caching.js
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,23 @@ | ||
// to be run with useLLInt = false | ||
var o = {}; | ||
|
||
function getSomeProperty(){ | ||
return o.someProperty; | ||
} | ||
|
||
var count = 0; | ||
function test(){ | ||
count++; | ||
if (count == 3) { | ||
Object.defineProperty(this, 'someProperty', { value : "okay" }); | ||
return getSomeProperty(); | ||
} | ||
return "okay"; | ||
} | ||
|
||
o.__defineGetter__('someProperty', test) | ||
|
||
for (var i = 0; i < 4; i++) { | ||
if (getSomeProperty() != "okay") | ||
throw ("Error: " + i); | ||
} |