Index: test/mjsunit/compiler/parallel-proto-change.js |
diff --git a/test/mjsunit/regress/regress-2489.js b/test/mjsunit/compiler/parallel-proto-change.js |
similarity index 79% |
copy from test/mjsunit/regress/regress-2489.js |
copy to test/mjsunit/compiler/parallel-proto-change.js |
index 882c4f794a88e24d1d64e86a466b27c39f51e625..1aa135a26d4e85b2f7088ffcb5a8ecf3847dc93b 100644 |
--- a/test/mjsunit/regress/regress-2489.js |
+++ b/test/mjsunit/compiler/parallel-proto-change.js |
@@ -26,25 +26,19 @@ |
// OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. |
// Flags: --allow-natives-syntax |
+// Flags: --parallel-recompilation --manual-parallel-recompilation |
-"use strict"; |
+function f(foo) { return foo.bar(); } |
-function f(a, b) { |
- return g("c", "d"); |
-} |
+var o = {}; |
+o.__proto__ = { __proto__: { bar: function() { return 1; } } }; |
-function g(a, b) { |
- g.constructor.apply(this, arguments); |
-} |
+assertEquals(1, f(o)); |
+assertEquals(1, f(o)); |
-g.constructor = function(a, b) { |
- assertEquals("c", a); |
- assertEquals("d", b); |
-} |
+%ForceParallelRecompile(f); |
+// Change the prototype chain during optimization. |
+o.__proto__.__proto__ = { bar: function() { return 2; } }; |
+%InstallRecompiledCode(f); |
-f("a", "b"); |
-f("a", "b"); |
-%OptimizeFunctionOnNextCall(f); |
-f("a", "b"); |
-g.x = "deopt"; |
-f("a", "b"); |
+assertEquals(2, f(o)); |