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