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

Unified Diff: test/mjsunit/json.js

Issue 11232002: Stress GC less by allocating exponentially growing string chunks in JSON.stringify. (Closed) Base URL: https://v8.googlecode.com/svn/branches/bleeding_edge
Patch Set: Created 8 years, 2 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 | « src/json-stringifier.h ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: test/mjsunit/json.js
diff --git a/test/mjsunit/json.js b/test/mjsunit/json.js
index 582414fec838d50d16c877a460459df921df9de2..8d8ca336c9e5a6b76b5f83b27bddbf356f2ff628 100644
--- a/test/mjsunit/json.js
+++ b/test/mjsunit/json.js
@@ -268,11 +268,14 @@ assertEquals('"toJSON 123"',
JSON.stringify({ toJSON : function() { return 'toJSON 123'; } }));
assertEquals('{"a":321}',
JSON.stringify({ a : { toJSON : function() { return 321; } } }));
+var counter = 0;
assertEquals('{"getter":123}',
- JSON.stringify({ get getter() { return 123; } }));
+ JSON.stringify({ get getter() { counter++; return 123; } }));
+assertEquals(1, counter);
assertEquals('{"a":"abc","b":"\u1234bc"}',
JSON.stringify({ a : "abc", b : "\u1234bc" }));
+
var a = { a : 1, b : 2 };
delete a.a;
assertEquals('{"b":2}', JSON.stringify(a));
« no previous file with comments | « src/json-stringifier.h ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698