Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(345)

Unified Diff: test/mjsunit/compiler/escape-analysis-4.js

Issue 1457683003: [turbofan] Initial support for escape analysis. (Closed) Base URL: https://chromium.googlesource.com/v8/v8.git@master
Patch Set: Created 5 years, 1 month ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
Index: test/mjsunit/compiler/escape-analysis-4.js
diff --git a/test/mjsunit/d8-worker-spawn-worker.js b/test/mjsunit/compiler/escape-analysis-4.js
similarity index 80%
copy from test/mjsunit/d8-worker-spawn-worker.js
copy to test/mjsunit/compiler/escape-analysis-4.js
index a114d8587e0ebc7095565cfebb3634e7fdefbbe7..324096cf7d7944a46ed007aa92168652c2681a64 100644
--- a/test/mjsunit/d8-worker-spawn-worker.js
+++ b/test/mjsunit/compiler/escape-analysis-4.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 --turbo-escape
+//
+
+function f(a) {
+ "use strict";
+ return arguments.length;
+}
- var w = new Worker(workerScript);
- w.postMessage(9);
- assertEquals(42, w.getMessage());
+function h() {
+ "use strict";
+ return arguments;
}
+
+function g() {
+ return "" + f(1,2,3) + " " + h(4,5,6);
+}
+
+assertEquals("3 [object Arguments]", g());
+assertEquals("3 [object Arguments]", g());
+%OptimizeFunctionOnNextCall(g);
+assertEquals("3 [object Arguments]", g());

Powered by Google App Engine
This is Rietveld 408576698