Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(1693)

Unified Diff: test/mjsunit/regress/regress-crbug-260345.js

Issue 19518008: Merged r15610, r15723, r15724, r15725, r15728 into 3.18 branch. (Closed) Base URL: https://v8.googlecode.com/svn/branches/3.18
Patch Set: Created 7 years, 5 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « test/cctest/test-api.cc ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: test/mjsunit/regress/regress-crbug-260345.js
diff --git a/test/mjsunit/regress/setter.js b/test/mjsunit/regress/regress-crbug-260345.js
similarity index 71%
copy from test/mjsunit/regress/setter.js
copy to test/mjsunit/regress/regress-crbug-260345.js
index e3a8000f2bc55c9ee09c483a1cc421305415b85d..75832ab4beb9e004dda914ffc2e23647f57ef979 100644
--- a/test/mjsunit/regress/setter.js
+++ b/test/mjsunit/regress/regress-crbug-260345.js
@@ -25,42 +25,35 @@
// (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
// OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
-function s(v) {
- v.x = 1;
+var steps = 100000;
+var undefined_values = [undefined, "go on"];
+var null_values = [null, "go on"];
+
+function get_undefined_object(i) {
+ return undefined_values[(i / steps) | 0];
}
-function c(p) {
- return {__proto__: p};
+function test_undefined() {
+ var objects = 0;
+ for (var i = 0; i < 2 * steps; i++) {
+ undefined == get_undefined_object(i) && objects++;
+ }
+ return objects;
}
-var p = {};
+assertEquals(steps, test_undefined());
-var o1 = c(p);
-var o2 = c(p);
-var o3 = c(p);
-var o4 = c(p);
-var o5 = c(p);
-// Initialize the store IC.
-s(o1);
-s(o2);
+function get_null_object(i) {
+ return null_values[(i / steps) | 0];
+}
-// Install a setter on p.x
-var count = 0;
-Object.defineProperty(p, "x", {
- set: function(x) {
- count += 1;
+function test_null() {
+ var objects = 0;
+ for (var i = 0; i < 2 * steps; i++) {
+ null == get_null_object(i) && objects++;
}
-});
-
-// Verify that the setter was called directly.
-o3.x = 20;
-assertEquals(1, count);
-
-// Verify that monomorphic prototype failure is triggered in the IC.
-s(o4);
-assertEquals(2, count);
+ return objects;
+}
-// Verify that the newly installed IC is correct.
-s(o5);
-assertEquals(3, count);
+assertEquals(steps, test_null());
« no previous file with comments | « test/cctest/test-api.cc ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698