Index: test/mjsunit/parallel-invalidate-transition-map.js |
diff --git a/test/mjsunit/manual-parallel-recompile.js b/test/mjsunit/parallel-invalidate-transition-map.js |
similarity index 68% |
copy from test/mjsunit/manual-parallel-recompile.js |
copy to test/mjsunit/parallel-invalidate-transition-map.js |
index 8d660e047c7702ee15c4e65966268856a8e9c7a7..42a266f556e6ea0f75a83ad453a6d96ce11c81f0 100644 |
--- a/test/mjsunit/manual-parallel-recompile.js |
+++ b/test/mjsunit/parallel-invalidate-transition-map.js |
@@ -1,4 +1,4 @@ |
-// Copyright 2012 the V8 project authors. All rights reserved. |
+// Copyright 2013 the V8 project authors. All rights reserved. |
// Redistribution and use in source and binary forms, with or without |
// modification, are permitted provided that the following conditions are |
// met: |
@@ -25,38 +25,32 @@ |
// (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: --allow-natives-syntax --expose-gc --parallel-recompilation |
+// Flags: --track-fields --track-double-fields --allow-natives-syntax |
+// Flags: --parallel-recompilation --parallel-recompilation-delay=50 |
function assertUnoptimized(fun) { |
assertTrue(%GetOptimizationStatus(fun) != 1); |
} |
-function f(x) { |
- var xx = x * x; |
- var xxstr = xx.toString(); |
- return xxstr.length; |
+function new_object() { |
+ var o = {}; |
+ o.a = 1; |
+ o.b = 2; |
+ return o; |
} |
-function g(x) { |
- var xxx = Math.sqrt(x) | 0; |
- var xxxstr = xxx.toString(); |
- return xxxstr.length; |
+function add_field(obj) { |
+ obj.c = 3; |
} |
-function k(x) { |
- return x * x; |
-} |
- |
-f(g(1)); |
-assertUnoptimized(f); |
-assertUnoptimized(g); |
- |
-%OptimizeFunctionOnNextCall(f, "parallel"); |
-%OptimizeFunctionOnNextCall(g, "parallel"); |
-f(g(2)); |
+add_field(new_object()); |
+add_field(new_object()); |
+%OptimizeFunctionOnNextCall(add_field, "parallel"); |
-assertUnoptimized(f); |
-assertUnoptimized(g); |
+var o = new_object(); |
+add_field(o); // Trigger optimization. |
+assertUnoptimized(add_field); // Not yet optimized. |
+o.c = 2.2; // Invalidate transition map. |
+%CompleteOptimization(add_field); // Conclude optimization with... |
+assertUnoptimized(add_field); // ... bailing out due to map dependency. |
-%WaitUntilOptimized(f); |
-%WaitUntilOptimized(g); |