Index: test/mjsunit/compiler/escape-analysis-7.js |
diff --git a/test/mjsunit/d8-worker-spawn-worker.js b/test/mjsunit/compiler/escape-analysis-7.js |
similarity index 83% |
copy from test/mjsunit/d8-worker-spawn-worker.js |
copy to test/mjsunit/compiler/escape-analysis-7.js |
index a114d8587e0ebc7095565cfebb3634e7fdefbbe7..30105f429a15f8a4186ab64e22fcdc89ce32a3cc 100644 |
--- a/test/mjsunit/d8-worker-spawn-worker.js |
+++ b/test/mjsunit/compiler/escape-analysis-7.js |
@@ -25,16 +25,27 @@ |
// (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 |
+// |
- var w = new Worker(workerScript); |
- w.postMessage(9); |
- assertEquals(42, w.getMessage()); |
+function f(a) { |
+ "use strict"; |
+ return arguments; |
} |
+ |
+function g(a) { |
+ "use strict"; |
+ var x = f(1,2,3); |
+ if (a) { |
+ x[1] = 5; |
+ } else { |
+ x[1] = 7; |
+ } |
+ |
+ return x[1]; |
+} |
+ |
+assertEquals(7, g()); |
+assertEquals(7, g()); |
+%OptimizeFunctionOnNextCall(g); |
+assertEquals(7, g()); |