| Index: test/mjsunit/parallel-initial-prototype-change.js
|
| diff --git a/test/mjsunit/elide-double-hole-check-5.js b/test/mjsunit/parallel-initial-prototype-change.js
|
| similarity index 77%
|
| copy from test/mjsunit/elide-double-hole-check-5.js
|
| copy to test/mjsunit/parallel-initial-prototype-change.js
|
| index d0970c8fe1f5d13419798df1de7c30fced885855..5544bebc1d49256f50b00a42d71a06f740ed7aaa 100644
|
| --- a/test/mjsunit/elide-double-hole-check-5.js
|
| +++ b/test/mjsunit/parallel-initial-prototype-change.js
|
| @@ -26,15 +26,25 @@
|
| // OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
|
|
|
| // Flags: --allow-natives-syntax
|
| +// Flags: --parallel-recompilation --parallel-recompilation-delay=50
|
| +
|
| +function assertUnoptimized(fun) {
|
| + assertTrue(%GetOptimizationStatus(fun) != 1);
|
| +}
|
|
|
| function f1(a, i) {
|
| return a[i] + 0.5;
|
| }
|
| +
|
| var arr = [0.0,,2.5];
|
| assertEquals(0.5, f1(arr, 0));
|
| assertEquals(0.5, f1(arr, 0));
|
| -Array.prototype[1] = 1.5;
|
| -%OptimizeFunctionOnNextCall(f1);
|
| -assertEquals(2, f1(arr, 1));
|
| -assertEquals(2, f1(arr, 1));
|
| +
|
| +// Optimized code of f1 depends on initial object and array maps.
|
| +%OptimizeFunctionOnNextCall(f1, "parallel");
|
| assertEquals(0.5, f1(arr, 0));
|
| +assertUnoptimized(f1); // Not yet optimized.
|
| +Object.prototype[1] = 1.5; // Invalidate current initial object map.
|
| +assertEquals(2, f1(arr, 1));
|
| +%CompleteOptimization(f1); // Conclude optimization with...
|
| +assertUnoptimized(f1); // ... bailing out due to map dependency.
|
|
|