Index: test/mjsunit/parallel-invalidate-transition-map.js |
diff --git a/test/mjsunit/compiler/parallel-proto-change.js b/test/mjsunit/parallel-invalidate-transition-map.js |
similarity index 73% |
copy from test/mjsunit/compiler/parallel-proto-change.js |
copy to test/mjsunit/parallel-invalidate-transition-map.js |
index aa1ac6de90952c3a0f5e2e3ea28c4f1d1dcdd9f1..42a266f556e6ea0f75a83ad453a6d96ce11c81f0 100644 |
--- a/test/mjsunit/compiler/parallel-proto-change.js |
+++ b/test/mjsunit/parallel-invalidate-transition-map.js |
@@ -25,26 +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 |
+// 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(foo) { return foo.bar(); } |
+function new_object() { |
+ var o = {}; |
+ o.a = 1; |
+ o.b = 2; |
+ return o; |
+} |
+ |
+function add_field(obj) { |
+ obj.c = 3; |
+} |
-var o = {}; |
-o.__proto__ = { __proto__: { bar: function() { return 1; } } }; |
+add_field(new_object()); |
+add_field(new_object()); |
+%OptimizeFunctionOnNextCall(add_field, "parallel"); |
-assertEquals(1, f(o)); |
-assertEquals(1, f(o)); |
+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. |
-%OptimizeFunctionOnNextCall(f, "parallel"); |
-assertEquals(1, f(o)); // Trigger optimization. |
-assertUnoptimized(f); // Optimization not yet done. |
-// Change the prototype chain during optimization to trigger map invalidation. |
-o.__proto__.__proto__ = { bar: function() { return 2; } }; |
-%CompleteOptimization(f); // Conclude optimization with... |
-assertUnoptimized(f); // ... bailing out due to map dependency. |
-assertEquals(2, f(o)); |