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

Unified Diff: test/mjsunit/regress/regress-2681.js

Issue 14731023: Don't flush code for generator functions. (Closed) Base URL: https://v8.googlecode.com/svn/branches/bleeding_edge
Patch Set: Update copyright year on new test Created 7 years, 7 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/objects-visiting-inl.h ('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-2681.js
diff --git a/test/mjsunit/regress/regress-2593.js b/test/mjsunit/regress/regress-2681.js
similarity index 77%
copy from test/mjsunit/regress/regress-2593.js
copy to test/mjsunit/regress/regress-2681.js
index b51b41c27e65d8f6344f3cc22f9fec2c5a99b92d..9841d84843593699a704eee8c3a2a48ecc3db1eb 100644
--- a/test/mjsunit/regress/regress-2593.js
+++ b/test/mjsunit/regress/regress-2681.js
@@ -25,37 +25,24 @@
// (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
// OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
-// Flags: --expose_gc
+// Flags: --expose-gc --noincremental-marking --harmony-generators
-p1 = { };
-p2 = { };
-p3 = { x : 1 };
-p2.__proto__ = p3
-p1.__proto__ = p2
+// Check that we are not flushing code for generators.
-// Normalize p1.
-p1.z = 1
-delete p1.z
-
-// Make sure all objects are in old space.
-for (var i = 0; i < 10; i++) gc();
-
-function f2() {
- p2.x;
+function flush_all_code() {
+ // Each GC ages code, and currently 6 gcs will flush all code.
+ for (var i = 0; i < 10; i++) gc();
}
-function f1() {
- return p1.x;
+function* g() {
+ yield 1;
+ yield 2;
}
-// Create load stub in p2.
-for (var i = 0; i < 10; i++) f2();
-
-// Create load stub in p2 for p1.
-for (var i = 0; i < 10; i++) f1();
-
-assertEquals(1, f1());
+var o = g();
+assertEquals({ value: 1, done: false }, o.next());
-p2.x = 2;
+flush_all_code();
-assertEquals(2, f1());
+assertEquals({ value: 2, done: false }, o.next());
+assertEquals({ value: undefined, done: true }, o.next());
« no previous file with comments | « src/objects-visiting-inl.h ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698