Index: test/mjsunit/compiler/escape-analysis-8.js |
diff --git a/test/mjsunit/d8-worker-spawn-worker.js b/test/mjsunit/compiler/escape-analysis-8.js |
similarity index 83% |
copy from test/mjsunit/d8-worker-spawn-worker.js |
copy to test/mjsunit/compiler/escape-analysis-8.js |
index a114d8587e0ebc7095565cfebb3634e7fdefbbe7..bc5b1d963eff300bd0017e090ee40b03a87a3ff1 100644 |
--- a/test/mjsunit/d8-worker-spawn-worker.js |
+++ b/test/mjsunit/compiler/escape-analysis-8.js |
@@ -25,16 +25,25 @@ |
// (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE |
// OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. |
-if (this.Worker) { |
- var workerScript = |
- `var w = new Worker('postMessage(42)'); |
- onmessage = function(parentMsg) { |
- w.postMessage(parentMsg); |
- var childMsg = w.getMessage(); |
- postMessage(childMsg); |
- };`; |
+// Flags: --allow-natives-syntax --turbo-escape |
+// |
+ |
+function f(a) { |
+ this.x=a; |
+ this.y=1; |
+} |
- var w = new Worker(workerScript); |
- w.postMessage(9); |
- assertEquals(42, w.getMessage()); |
+function g() { |
+ "use strict"; |
+ var o = new f(2); |
+ while (o.y < 4) { |
+ o.x = 5; |
+ o.y = 5; |
+ } |
+ return o.x; |
} |
+ |
+assertEquals(5, g()); |
+assertEquals(5, g()); |
+%OptimizeFunctionOnNextCall(g); |
+assertEquals(5, g()); |