Import Cobalt 20.master.0.234144
Includes the following patches:
https://cobalt-review.googlesource.com/c/cobalt/+/5590
by n1214.hwang@samsung.com
https://cobalt-review.googlesource.com/c/cobalt/+/5530
by errong.leng@samsung.com
https://cobalt-review.googlesource.com/c/cobalt/+/5570
by devin.cai@mediatek.com
diff --git a/src/v8/test/js-perf-test/Parsing/arrowfunctions.js b/src/v8/test/js-perf-test/Parsing/arrowfunctions.js
new file mode 100644
index 0000000..40955ea
--- /dev/null
+++ b/src/v8/test/js-perf-test/Parsing/arrowfunctions.js
@@ -0,0 +1,60 @@
+// Copyright 2018 the V8 project authors. All rights reserved.
+// Use of this source code is governed by a BSD-style license that can be
+// found in the LICENSE file.
+
+new BenchmarkSuite("ArrowFunctionShort", [1000], [
+ new Benchmark("ArrowFunctionShort", false, true, iterations, Run, ArrowFunctionShortSetup)
+]);
+
+new BenchmarkSuite("ArrowFunctionLong", [1000], [
+ new Benchmark("ArrowFunctionLong", false, true, iterations, Run, ArrowFunctionLongSetup)
+]);
+
+new BenchmarkSuite("CommaSepExpressionListShort", [1000], [
+ new Benchmark("CommaSepExpressionListShort", false, true, iterations, Run, CommaSepExpressionListShortSetup)
+]);
+
+new BenchmarkSuite("CommaSepExpressionListLong", [1000], [
+ new Benchmark("CommaSepExpressionListLong", false, true, iterations, Run, CommaSepExpressionListLongSetup)
+]);
+
+new BenchmarkSuite("CommaSepExpressionListLate", [1000], [
+ new Benchmark("CommaSepExpressionListLate", false, true, iterations, Run, CommaSepExpressionListLateSetup)
+]);
+
+new BenchmarkSuite("FakeArrowFunction", [1000], [
+ new Benchmark("FakeArrowFunction", false, true, iterations, Run, FakeArrowFunctionSetup)
+]);
+
+function ArrowFunctionShortSetup() {
+ code = "let a;\n" + "a = (a,b) => { return a+b; }\n".repeat(50)
+}
+
+function ArrowFunctionLongSetup() {
+ code = "let a;\n" + "a = (a,b,c,d,e,f,g,h,i,j) => { return a+b; }\n".repeat(50)
+}
+
+function CommaSepExpressionListShortSetup() {
+ code = "let a;\n" + "a = (a,1)\n".repeat(50)
+}
+
+function CommaSepExpressionListLongSetup() {
+ code = "let a; let b; let c;\n" + "a = (a,2,3,4,5,b,c,1,7,1)\n".repeat(50)
+}
+
+function CommaSepExpressionListLateSetup() {
+ code = "let a; let b; let c; let d; let e; let f; let g; let h; let i;\n"
+ + "a = (a,b,c,d,e,f,g,h,i,1)\n".repeat(50)
+}
+
+function FakeArrowFunctionSetup() {
+ code = "let a; let b; let c; let d; let e; let f; let g; let h; let i; let j;\n"
+ + "a = (a,b,c,d,e,f,g,h,i,j)\n".repeat(50)
+}
+
+function Run() {
+ if (code == undefined) {
+ throw new Error("No test data");
+ }
+ eval(code);
+}
diff --git a/src/v8/test/js-perf-test/Parsing/comments.js b/src/v8/test/js-perf-test/Parsing/comments.js
index e5dbab1..5d6b70f 100644
--- a/src/v8/test/js-perf-test/Parsing/comments.js
+++ b/src/v8/test/js-perf-test/Parsing/comments.js
@@ -2,22 +2,18 @@
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.
-const iterations = 100;
-
-new BenchmarkSuite('OneLineComment', [1000], [
- new Benchmark('OneLineComment', false, true, iterations, Run, OneLineCommentSetup)
+new BenchmarkSuite("OneLineComment", [1000], [
+ new Benchmark("OneLineComment", false, true, iterations, Run, OneLineCommentSetup)
]);
-new BenchmarkSuite('OneLineComments', [1000], [
- new Benchmark('OneLineComments', false, true, iterations, Run, OneLineCommentsSetup)
+new BenchmarkSuite("OneLineComments", [1000], [
+ new Benchmark("OneLineComments", false, true, iterations, Run, OneLineCommentsSetup)
]);
-new BenchmarkSuite('MultiLineComment', [1000], [
- new Benchmark('MultiLineComment', false, true, iterations, Run, MultiLineCommentSetup)
+new BenchmarkSuite("MultiLineComment", [1000], [
+ new Benchmark("MultiLineComment", false, true, iterations, Run, MultiLineCommentSetup)
]);
-let code;
-
function OneLineCommentSetup() {
code = "//" + " This is a comment... ".repeat(600);
%FlattenString(code);
diff --git a/src/v8/test/js-perf-test/Parsing/run.js b/src/v8/test/js-perf-test/Parsing/run.js
index e6531af..d699af2 100644
--- a/src/v8/test/js-perf-test/Parsing/run.js
+++ b/src/v8/test/js-perf-test/Parsing/run.js
@@ -3,14 +3,19 @@
// found in the LICENSE file.
-load('../base.js');
+load("../base.js");
-load('comments.js');
+const iterations = 100;
+let code;
+
+load("comments.js");
+load("strings.js");
+load("arrowfunctions.js")
var success = true;
function PrintResult(name, result) {
- print(name + '-Parsing(Score): ' + result);
+ print(name + "-Parsing(Score): " + result);
}
diff --git a/src/v8/test/js-perf-test/Parsing/strings.js b/src/v8/test/js-perf-test/Parsing/strings.js
new file mode 100644
index 0000000..63eef38
--- /dev/null
+++ b/src/v8/test/js-perf-test/Parsing/strings.js
@@ -0,0 +1,37 @@
+// Copyright 2018 the V8 project authors. All rights reserved.
+// Use of this source code is governed by a BSD-style license that can be
+// found in the LICENSE file.
+
+new BenchmarkSuite("SingleLineString", [1000], [
+ new Benchmark("SingleLineString", false, true, iterations, Run, SingleLineStringSetup)
+]);
+
+new BenchmarkSuite("SingleLineStrings", [3000], [
+ new Benchmark("SingleLineStrings", false, true, iterations, Run, SingleLineStringsSetup)
+]);
+
+new BenchmarkSuite("MultiLineString", [1000], [
+ new Benchmark("MultiLineString", false, true, iterations, Run, MultiLineStringSetup)
+]);
+
+function SingleLineStringSetup() {
+ code = "\"" + "This is a string".repeat(600) + "\"";
+ %FlattenString(code);
+}
+
+function SingleLineStringsSetup() {
+ code = "\"This is a string\"\n".repeat(600);
+ %FlattenString(code);
+}
+
+function MultiLineStringSetup() {
+ code = "\"" + "This is a string \\\n".repeat(600) + "\"";
+ %FlattenString(code);
+}
+
+function Run() {
+ if (code == undefined) {
+ throw new Error("No test data");
+ }
+ eval(code);
+}