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

Side by Side Diff: test/mjsunit/regress/regress-json-stringify-gc.js

Issue 11315009: Handle edge cases in basic JSON.stringify. (Closed) Base URL: https://v8.googlecode.com/svn/branches/bleeding_edge
Patch Set: rebased Created 8 years, 1 month 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 unified diff | Download patch | Annotate | Revision Log
« no previous file with comments | « test/mjsunit/json2.js ('k') | no next file » | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 // Copyright 2012 the V8 project authors. All rights reserved. 1 // Copyright 2012 the V8 project authors. All rights reserved.
2 // Redistribution and use in source and binary forms, with or without 2 // Redistribution and use in source and binary forms, with or without
3 // modification, are permitted provided that the following conditions are 3 // modification, are permitted provided that the following conditions are
4 // met: 4 // met:
5 // 5 //
6 // * Redistributions of source code must retain the above copyright 6 // * Redistributions of source code must retain the above copyright
7 // notice, this list of conditions and the following disclaimer. 7 // notice, this list of conditions and the following disclaimer.
8 // * Redistributions in binary form must reproduce the above 8 // * Redistributions in binary form must reproduce the above
9 // copyright notice, this list of conditions and the following 9 // copyright notice, this list of conditions and the following
10 // disclaimer in the documentation and/or other materials provided 10 // disclaimer in the documentation and/or other materials provided
(...skipping 19 matching lines...) Expand all
30 for (var i = 0; i < 128; i++) { 30 for (var i = 0; i < 128; i++) {
31 new_space_string += String.fromCharCode((Math.random() * 26 + 65) | 0); 31 new_space_string += String.fromCharCode((Math.random() * 26 + 65) | 0);
32 } 32 }
33 for (var i = 0; i < 10000; i++) a.push(new_space_string); 33 for (var i = 0; i < 10000; i++) a.push(new_space_string);
34 34
35 // At some point during the first stringify, allocation causes a GC and 35 // At some point during the first stringify, allocation causes a GC and
36 // new_space_string is moved to old space. Make sure that this does not 36 // new_space_string is moved to old space. Make sure that this does not
37 // screw up reading from the correct location. 37 // screw up reading from the correct location.
38 json1 = JSON.stringify(a); 38 json1 = JSON.stringify(a);
39 json2 = JSON.stringify(a); 39 json2 = JSON.stringify(a);
40 assertEquals(json1, json2); 40 assertEquals(json1, json2, "GC caused JSON.stringify to fail.");
41 41
OLDNEW
« no previous file with comments | « test/mjsunit/json2.js ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698