Index: test/mjsunit/manual-parallel-recompile.js |
diff --git a/test/mjsunit/manual-parallel-recompile.js b/test/mjsunit/manual-parallel-recompile.js |
index 8d660e047c7702ee15c4e65966268856a8e9c7a7..f090ff497d501a136367ef21af33d040364427a9 100644 |
--- a/test/mjsunit/manual-parallel-recompile.js |
+++ b/test/mjsunit/manual-parallel-recompile.js |
@@ -25,12 +25,17 @@ |
// (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: --allow-natives-syntax --expose-gc |
+// Flags: --parallel-recompilation --parallel-recompilation-delay=50 |
function assertUnoptimized(fun) { |
assertTrue(%GetOptimizationStatus(fun) != 1); |
} |
+function assertOptimized(fun) { |
+ assertTrue(%GetOptimizationStatus(fun) != 2); |
+} |
+ |
function f(x) { |
var xx = x * x; |
var xxstr = xx.toString(); |
@@ -53,10 +58,13 @@ assertUnoptimized(g); |
%OptimizeFunctionOnNextCall(f, "parallel"); |
%OptimizeFunctionOnNextCall(g, "parallel"); |
-f(g(2)); |
+f(g(2)); // Trigger optimization. |
-assertUnoptimized(f); |
+assertUnoptimized(f); // Not yet optimized. |
assertUnoptimized(g); |
-%WaitUntilOptimized(f); |
-%WaitUntilOptimized(g); |
+%CompleteOptimization(f); // Wait till optimized code is installed. |
+%CompleteOptimization(g); |
+ |
+assertOptimized(f); // Optimized now. |
+assertOptimized(g); |