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()); |