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/Strings/harmony-string.js b/src/v8/test/js-perf-test/Strings/harmony-string.js
index c2eac4e..cbab3d9 100644
--- a/src/v8/test/js-perf-test/Strings/harmony-string.js
+++ b/src/v8/test/js-perf-test/Strings/harmony-string.js
@@ -2,19 +2,39 @@
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.
-new BenchmarkSuite('StringFunctions', [1000], [
+new BenchmarkSuite('StringRepeat', [10], [
new Benchmark('StringRepeat', false, false, 0,
- Repeat, RepeatSetup, RepeatTearDown),
+ Repeat, RepeatSetup, RepeatTearDown),
+]);
+
+new BenchmarkSuite('StringStartsWith', [10], [
new Benchmark('StringStartsWith', false, false, 0,
- StartsWith, WithSetup, WithTearDown),
+ StartsWith, WithSetup, WithTearDown),
+]);
+
+new BenchmarkSuite('StringEndsWith', [10], [
new Benchmark('StringEndsWith', false, false, 0,
- EndsWith, WithSetup, WithTearDown),
+ EndsWith, WithSetup, WithTearDown),
+]);
+
+new BenchmarkSuite('StringIncludes', [10], [
new Benchmark('StringIncludes', false, false, 0,
- Includes, IncludesSetup, WithTearDown),
+ Includes, IncludesSetup, WithTearDown),
+]);
+
+new BenchmarkSuite('StringFromCodePoint', [10000], [
new Benchmark('StringFromCodePoint', false, false, 0,
- FromCodePoint, FromCodePointSetup, FromCodePointTearDown),
+ FromCodePoint, FromCodePointSetup, FromCodePointTearDown),
+]);
+
+new BenchmarkSuite('StringCodePointAt', [1000], [
new Benchmark('StringCodePointAt', false, false, 0,
- CodePointAt, CodePointAtSetup, CodePointAtTearDown),
+ CodePointAt, CodePointAtSetup, CodePointAtTearDown),
+]);
+
+new BenchmarkSuite('StringCodePointAtSum', [100000], [
+ new Benchmark('StringCodePointAtSum', false, true, 3,
+ CodePointAtSum, CodePointAtSumSetup),
]);
@@ -32,7 +52,7 @@
function RepeatTearDown() {
var expected = "";
- for(var i = 0; i < 1000; i++) {
+ for (var i = 0; i < 1000; i++) {
expected += stringRepeatSource;
}
return result === expected;
@@ -70,19 +90,20 @@
}
var MAX_CODE_POINT = 0xFFFFF;
+const K = 1024;
function FromCodePointSetup() {
- result = new Array(MAX_CODE_POINT + 1);
+ result = new Array((MAX_CODE_POINT + 1) / K);
}
function FromCodePoint() {
- for (var i = 0; i <= MAX_CODE_POINT; i++) {
+ for (var i = 0; i <= MAX_CODE_POINT; i += K) {
result[i] = String.fromCodePoint(i);
}
}
function FromCodePointTearDown() {
- for (var i = 0; i <= MAX_CODE_POINT; i++) {
+ for (var i = 0; i <= MAX_CODE_POINT; i += K) {
if (i !== result[i].codePointAt(0)) return false;
}
return true;
@@ -92,8 +113,8 @@
var allCodePoints;
function CodePointAtSetup() {
- allCodePoints = new Array(MAX_CODE_POINT + 1);
- for (var i = 0; i <= MAX_CODE_POINT; i++) {
+ allCodePoints = new Array((MAX_CODE_POINT + 1) / K);
+ for (var i = 0; i <= MAX_CODE_POINT; i += K) {
allCodePoints = String.fromCodePoint(i);
}
result = undefined;
@@ -101,11 +122,24 @@
function CodePointAt() {
result = 0;
- for (var i = 0; i <= MAX_CODE_POINT; i++) {
+ for (var i = 0; i <= MAX_CODE_POINT; i += K) {
result += allCodePoints.codePointAt(i);
}
}
function CodePointAtTearDown() {
- return result === MAX_CODE_POINT * (MAX_CODE_POINT + 1) / 2;
+ return result === (MAX_CODE_POINT / K) * ((MAX_CODE_POINT / K) + 1) / 2;
+}
+
+var payload;
+
+function CodePointAtSumSetup() {
+ payload = "abcdefghijklmnopqrstuvwxyz";
+ for(var j = 0; j < 16; ++j) payload += payload;
+}
+
+function CodePointAtSum() {
+ var c = 0;
+ for(j=payload.length-1; j >=0; --j) c+=payload.charCodeAt(j);
+ return c;
}
diff --git a/src/v8/test/js-perf-test/Strings/run.js b/src/v8/test/js-perf-test/Strings/run.js
index 66dd9b2..b94f14f 100644
--- a/src/v8/test/js-perf-test/Strings/run.js
+++ b/src/v8/test/js-perf-test/Strings/run.js
@@ -4,9 +4,7 @@
load('../base.js');
-load('harmony-string.js');
-load('string-indexof.js');
-
+load(arguments[0] + '.js');
var success = true;
@@ -20,7 +18,6 @@
success = false;
}
-
BenchmarkSuite.config.doWarmup = undefined;
BenchmarkSuite.config.doDeterministic = undefined;
diff --git a/src/v8/test/js-perf-test/Strings/string-indexof.js b/src/v8/test/js-perf-test/Strings/string-indexof.js
index a2049e0..1e077bc 100644
--- a/src/v8/test/js-perf-test/Strings/string-indexof.js
+++ b/src/v8/test/js-perf-test/Strings/string-indexof.js
@@ -34,36 +34,3 @@
return sum;
}
-
-new BenchmarkSuite('StringCharCodeAtConstant', [3], [
- new Benchmark('StringIndexOfConstant', true, false, 0,
- StringCharCodeAtConstant),
-]);
-
-new BenchmarkSuite('StringCharCodeAtNonConstant', [3], [
- new Benchmark('StringIndexOfNonConstant', true, false, 0,
- StringCharCodeAtNonConstant),
-]);
-
-const string = "qweruiplkjhgfdsazxccvbnm";
-const indices = [1, 13, 32, 100, "xx"];
-
-function StringCharCodeAtConstant() {
- var sum = 0;
-
- for (var j = 0; j < indices.length - 1; ++j) {
- sum += string.charCodeAt(indices[j] | 0);
- }
-
- return sum;
-}
-
-function StringCharCodeAtNonConstant() {
- var sum = 0;
-
- for (var j = 0; j < indices.length - 1; ++j) {
- sum += string.charCodeAt(indices[j]);
- }
-
- return sum;
-}
diff --git a/src/v8/test/js-perf-test/Strings/string-localeCompare.js b/src/v8/test/js-perf-test/Strings/string-localeCompare.js
new file mode 100644
index 0000000..6c8b609
--- /dev/null
+++ b/src/v8/test/js-perf-test/Strings/string-localeCompare.js
@@ -0,0 +1,19 @@
+// 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('StringLocaleCompare', [1000000], [
+ new Benchmark('StringLocaleCompare', false, false, 0,
+ StringLocaleCompare),
+]);
+
+function StringLocaleCompare() {
+ var array = ["XYZ", "mno", "abc", "EFG", "ijk", "123", "tuv", "234", "efg"];
+
+ var sum = 0;
+ for (var j = 0; j < array.length; ++j) {
+ sum += "fox".localeCompare(array[j]);
+ }
+
+ return sum;
+}
diff --git a/src/v8/test/js-perf-test/Strings/string-matchall.js b/src/v8/test/js-perf-test/Strings/string-matchall.js
new file mode 100644
index 0000000..2b86d50
--- /dev/null
+++ b/src/v8/test/js-perf-test/Strings/string-matchall.js
@@ -0,0 +1,77 @@
+// 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.
+
+(() => {
+
+function Internalize(s) {
+ return Object.keys({[s]:0})[0];
+}
+
+const string = Internalize('a'.repeat(100));
+let pattern;
+let result;
+
+const setupString = () => pattern = '.';
+const setupRegExp = () => pattern = /./g;
+const setupZeroWidth = () => pattern = /(?:)/g;
+const setupZeroWidthUnicode = () => pattern = /(?:)/gu;
+
+function benchIteratorCreation() {
+ result = string.matchAll(pattern);
+}
+
+function benchBuiltin() {
+ for (const match of string.matchAll(pattern)) {
+ result = match[0];
+ }
+}
+
+function benchManualString() {
+ let regexp = new RegExp(pattern, 'g');
+ let match;
+ while ((match = regexp.exec(string)) !== null) {
+ result = match[0];
+ }
+}
+
+function benchManualRegExp() {
+ let match;
+ while ((match = pattern.exec(string)) !== null) {
+ result = match[0];
+ }
+}
+
+// Iterator Creation
+new BenchmarkSuite('StringMatchAllBuiltinRegExpIteratorCreation', [20], [
+ new Benchmark('StringMatchAllBuiltinRegExpIteratorCreation', false, false, 0, benchIteratorCreation, setupRegExp)
+]);
+new BenchmarkSuite('StringMatchAllBuiltinStringIteratorCreation', [20], [
+ new Benchmark('StringMatchAllBuiltinStringIteratorCreation', false, false, 0, benchIteratorCreation, setupString)
+]);
+
+// String
+new BenchmarkSuite('StringMatchAllBuiltinString', [20], [
+ new Benchmark('StringMatchAllBuiltinString', false, false, 0, benchBuiltin, setupString)
+]);
+new BenchmarkSuite('StringMatchAllManualString', [20], [
+ new Benchmark('StringMatchAllManualString', false, false, 0, benchManualString, setupString)
+]);
+
+// RegExp
+new BenchmarkSuite('StringMatchAllBuiltinRegExp', [20], [
+ new Benchmark('StringMatchAllBuiltinRegExp', false, false, 0, benchBuiltin, setupRegExp)
+]);
+new BenchmarkSuite('StringMatchAllManualRegExp', [20], [
+ new Benchmark('StringMatchAllManualRegExp', false, false, 0, benchManualRegExp, setupRegExp)
+]);
+
+// Zero width
+new BenchmarkSuite('StringMatchAllBuiltinZeroWidth', [20], [
+ new Benchmark('StringMatchAllBuiltinZeroWidth', false, false, 0, benchBuiltin, setupZeroWidth)
+]);
+new BenchmarkSuite('StringMatchAllBuiltinZeroWidthUnicode', [20], [
+ new Benchmark('StringMatchAllBuiltinZeroWidthUnicode', false, false, 0, benchBuiltin, setupZeroWidthUnicode)
+]);
+
+})();
diff --git a/src/v8/test/js-perf-test/Strings/string-normalize.js b/src/v8/test/js-perf-test/Strings/string-normalize.js
new file mode 100644
index 0000000..21a8a59
--- /dev/null
+++ b/src/v8/test/js-perf-test/Strings/string-normalize.js
@@ -0,0 +1,38 @@
+// Copyright 2019 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('StringNormalize', [5], [
+ new Benchmark('StringNormalize', false, false, 0,
+ StringNormalize),
+]);
+new BenchmarkSuite('StringNormalizeNFD', [5], [
+ new Benchmark('StringNormalizeNFD', false, false, 0,
+ StringNormalizeNFD),
+]);
+new BenchmarkSuite('StringNormalizeNFKC', [5], [
+ new Benchmark('StringNormalizeNFKC', false, false, 0,
+ StringNormalizeNFKC),
+]);
+new BenchmarkSuite('StringNormalizeNFKD', [5], [
+ new Benchmark('StringNormalizeNFKD', false, false, 0,
+ StringNormalizeNFKD),
+]);
+
+const shortString = "àèìòùáéíóúäëïöüÿâêîôûãõñ";
+
+function StringNormalize() {
+ return shortString.normalize();
+}
+
+function StringNormalizeNFD() {
+ return shortString.normalize("NFD");
+}
+
+function StringNormalizeNFKC() {
+ return shortString.normalize("NFKC");
+}
+
+function StringNormalizeNFKD() {
+ return shortString.normalize("NFKD");
+}
diff --git a/src/v8/test/js-perf-test/Strings/string-split.js b/src/v8/test/js-perf-test/Strings/string-split.js
new file mode 100644
index 0000000..432129f
--- /dev/null
+++ b/src/v8/test/js-perf-test/Strings/string-split.js
@@ -0,0 +1,81 @@
+// 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('ShortSubjectEmptySeparator', [5], [
+ new Benchmark('ShortSubjectEmptySeparator', true, false, 0,
+ ShortSubjectEmptySeparator),
+]);
+
+new BenchmarkSuite('LongSubjectEmptySeparator', [1000], [
+ new Benchmark('LongSubjectEmptySeparator', true, false, 0,
+ LongSubjectEmptySeparator),
+]);
+
+new BenchmarkSuite('ShortTwoBytesSubjectEmptySeparator', [5], [
+ new Benchmark('ShortTwoBytesSubjectEmptySeparator', true, false, 0,
+ ShortTwoBytesSubjectEmptySeparator),
+]);
+
+new BenchmarkSuite('LongTwoBytesSubjectEmptySeparator', [1000], [
+ new Benchmark('LongTwoBytesSubjectEmptySeparator', true, false, 0,
+ LongTwoBytesSubjectEmptySeparator),
+]);
+
+new BenchmarkSuite('ShortSubject', [5], [
+ new Benchmark('ShortSubject', true, false, 0,
+ ShortSubject),
+]);
+
+new BenchmarkSuite('LongSubject', [1000], [
+ new Benchmark('LongSubject', true, false, 0,
+ LongSubject),
+]);
+
+new BenchmarkSuite('ShortTwoBytesSubject', [5], [
+ new Benchmark('ShortTwoBytesSubject', true, false, 0,
+ ShortTwoBytesSubject),
+]);
+
+new BenchmarkSuite('LongTwoBytesSubject', [1000], [
+ new Benchmark('LongTwoBytesSubject', true, false, 0,
+ LongTwoBytesSubject),
+]);
+
+const shortString = "ababaabcdeaaaaaab";
+const shortTwoBytesString = "\u0429\u0428\u0428\u0429\u0429\u0429\u0428\u0429\u0429";
+// Use Array.join to create a flat string
+const longString = new Array(0x500).fill("abcde").join('');
+const longTwoBytesString = new Array(0x500).fill("\u0427\u0428\u0429\u0430").join('');
+
+function ShortSubjectEmptySeparator() {
+ shortString.split('');
+}
+
+function LongSubjectEmptySeparator() {
+ longString.split('');
+}
+
+function ShortTwoBytesSubjectEmptySeparator() {
+ shortTwoBytesString.split('');
+}
+
+function LongTwoBytesSubjectEmptySeparator() {
+ longTwoBytesString.split('');
+}
+
+function ShortSubject() {
+ shortString.split('a');
+}
+
+function LongSubject() {
+ longString.split('a');
+}
+
+function ShortTwoBytesSubject() {
+ shortTwoBytesString.split('\u0428');
+}
+
+function LongTwoBytesSubject() {
+ longTwoBytesString.split('\u0428');
+}
diff --git a/src/v8/test/js-perf-test/Strings/string-startsendswith-comp.js b/src/v8/test/js-perf-test/Strings/string-startsendswith-comp.js
new file mode 100644
index 0000000..71484d2
--- /dev/null
+++ b/src/v8/test/js-perf-test/Strings/string-startsendswith-comp.js
@@ -0,0 +1,47 @@
+// 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.
+
+function createSuiteWithWarmup( name, count, fn) {
+ new BenchmarkSuite(name, [count], [
+ new Benchmark(name, true, false, 0, fn),
+ ]);
+}
+
+const inputs = [
+ 'I\xF1t\xEBrn\xE2ti\xF4n\xE0liz\xE6ti\xF8n\u2603\uD83D\uDCA9\uFFFD',
+ 'Lorem ipsum dolor sit amet, consectetur adipiscing elit.',
+ 'Integer eu augue suscipit, accumsan ipsum nec, sagittis sem.',
+ 'In vitae pellentesque dolor. Curabitur leo nunc, luctus vitae',
+ 'risus eget, fermentum hendrerit justo.',
+];
+const first = 'I';
+
+function helper(fn) {
+ let sum = 0;
+ for (const input of inputs) {
+ sum += fn(input);
+ }
+ return sum;
+}
+
+function startsWith(string) {
+ return string.startsWith(first);
+}
+
+function startsIndex(string) {
+ return string[0] === first;
+}
+
+function endsWith(string) {
+ return string.endsWith(first);
+}
+
+function endsIndex(string) {
+ return string[string.length - 1] === first;
+}
+
+createSuiteWithWarmup('startsWith', 1, () => helper(startsWith));
+createSuiteWithWarmup('startsIndex', 1, () => helper(startsIndex));
+createSuiteWithWarmup('endsWith', 1, () => helper(endsWith));
+createSuiteWithWarmup('endsIndex', 1, () => helper(endsIndex));
diff --git a/src/v8/test/js-perf-test/Strings/string-startswith.js b/src/v8/test/js-perf-test/Strings/string-startswith.js
new file mode 100644
index 0000000..4b0379b
--- /dev/null
+++ b/src/v8/test/js-perf-test/Strings/string-startswith.js
@@ -0,0 +1,78 @@
+// Copyright 2019 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.
+
+function createSuite(name, count, fn) {
+ new BenchmarkSuite(name, [count], [new Benchmark(name, true, false, 0, fn)]);
+}
+
+const inputs = [
+ 'Lorem ipsum dolor sit amet, consectetur adipiscing elit.',
+ 'Integer eu augue suscipit, accumsan ipsum nec, sagittis sem.',
+ 'In vitae pellentesque dolor. Curabitur leo nunc, luctus vitae',
+ 'risus eget, fermentum hendrerit justo.',
+ 'hello'.repeat(1024),
+ 'h',
+ ''
+];
+const firsts = ['I', 'Integer', 'Lorem', 'risus', 'hello'];
+
+function simpleHelper() {
+ let sum = 0;
+ for (const input of inputs) {
+ for (const first of firsts) {
+ sum += input.startsWith(first);
+ }
+ }
+ return sum;
+}
+
+function consInputHelper() {
+ let sum = 0;
+ for (const inputOne of inputs) {
+ for (const inputTwo of inputs) {
+ for (const first of firsts) {
+ // Skip if the length is too small for %ConstructConsString
+ if (inputOne.length + inputTwo.length < 13) break;
+ sum += %ConstructConsString(inputOne, inputTwo).startsWith(first);
+ }
+ }
+ }
+ return sum;
+}
+
+function consFirstHelper() {
+ let sum = 0;
+ for (const input of inputs) {
+ for (const firstOne of firsts) {
+ for (const firstTwo of firsts) {
+ // Skip if the length is too small for %ConstructConsString
+ if (firstOne.length + firstTwo.length < 13) break;
+ sum += input.startsWith(%ConstructConsString(firstOne, firstTwo));
+ }
+ }
+ }
+ return sum;
+}
+
+function doubleConsHelper() {
+ let sum = 0;
+ for (const inputOne of inputs) {
+ for (const inputTwo of inputs) {
+ for (const firstOne of firsts) {
+ for (const firstTwo of firsts) {
+ // Skip if the length is too small for %ConstructConsString
+ if (inputOne.length + inputTwo.length < 13 || firstOne.length + firstTwo.length) break;
+ sum += % ConstructConsString(inputOne, inputTwo).startsWith(
+ % ConstructConsString(firstOne, firstTwo)
+ );
+ }
+ }
+ }
+ }
+}
+
+createSuite('DirectStringsDirectSearch', 1000, simpleHelper);
+createSuite('ConsStringsDirectSearch', 1000, consInputHelper);
+createSuite('DirectStringsConsSearch', 1000, consFirstHelper);
+createSuite('ConsStringsConsSearch', 1000, doubleConsHelper);
diff --git a/src/v8/test/js-perf-test/Strings/string-stringat-comp.js b/src/v8/test/js-perf-test/Strings/string-stringat-comp.js
new file mode 100644
index 0000000..deb95e1
--- /dev/null
+++ b/src/v8/test/js-perf-test/Strings/string-stringat-comp.js
@@ -0,0 +1,44 @@
+// Copyright 2017 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.
+
+const input = 'äϠ�𝌆 Lorem ipsum test test';
+
+function helper(fn) {
+ var sum = 0;
+ for (var i = 0; i < input.length; i++) {
+ sum += fn(input, i, i);
+ }
+ return sum;
+}
+
+function charCodeAt(str, i) {
+ return str.charCodeAt(i) === 116;
+}
+
+function charCodeAtBoth(str, i, j) {
+ return str.charCodeAt(j) == str.charCodeAt(i);
+}
+
+function charAt(str, i) {
+ return 't' == str.charAt(i);
+}
+
+function charAtNever(str, i) {
+ return '𝌆' == str.charAt(i);
+}
+
+function charAtBoth(str, i, j) {
+ return str.charAt(j) == str.charAt(i);
+}
+
+function stringIndex(str, i) {
+ return str[i] === 't';
+}
+
+createSuiteWithWarmup('charCodeAt_const', 1, () => helper(charCodeAt));
+createSuiteWithWarmup('charCodeAt_both', 1, () => helper(charCodeAtBoth));
+createSuiteWithWarmup('charAt_const', 1, () => helper(charAt));
+createSuiteWithWarmup('charAt_never', 1, () => helper(charAtNever));
+createSuiteWithWarmup('charAt_both', 1, () => helper(charAtBoth));
+createSuiteWithWarmup('stringIndex_const', 1, () => helper(stringIndex));
diff --git a/src/v8/test/js-perf-test/Strings/string-stringat.js b/src/v8/test/js-perf-test/Strings/string-stringat.js
new file mode 100644
index 0000000..1e0be73
--- /dev/null
+++ b/src/v8/test/js-perf-test/Strings/string-stringat.js
@@ -0,0 +1,129 @@
+// Copyright 2017 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('StringCharCodeAtConstant', [3], [
+ new Benchmark('StringCharCodeAtConstant', true, false, 0,
+ StringCharCodeAtConstant),
+]);
+
+new BenchmarkSuite('StringCharCodeAtNonConstant', [3], [
+ new Benchmark('StringCharCodeAtNonConstant', true, false, 0,
+ StringCharCodeAtNonConstant),
+]);
+
+new BenchmarkSuite('StringCharCodeAtConstantInbounds', [3], [
+ new Benchmark('StringCharCodeAtConstantInbounds', true, false, 0,
+ StringCharCodeAtConstantInbounds),
+]);
+
+new BenchmarkSuite('StringCharCodeAtNonConstantInbounds', [3], [
+ new Benchmark('StringCharCodeAtNonConstantInbounds', true, false, 0,
+ StringCharCodeAtNonConstantInbounds),
+]);
+
+const string = "qweruiplkjhgfdsazxccvbnm";
+const indices = [1, 13, 32, 100, "xx"];
+const indicesInbounds = [1, 7, 13, 17, "xx"];
+
+function StringCharCodeAtConstant() {
+ var sum = 0;
+
+ for (var j = 0; j < indices.length - 1; ++j) {
+ sum += string.charCodeAt(indices[j] | 0);
+ }
+
+ return sum;
+}
+
+function StringCharCodeAtNonConstant() {
+ var sum = 0;
+
+ for (var j = 0; j < indices.length - 1; ++j) {
+ sum += string.charCodeAt(indices[j]);
+ }
+
+ return sum;
+}
+
+function StringCharCodeAtConstantInbounds() {
+ var sum = 0;
+
+ for (var j = 0; j < indicesInbounds.length - 1; ++j) {
+ sum += string.charCodeAt(indicesInbounds[j] | 0);
+ }
+
+ return sum;
+}
+
+function StringCharCodeAtNonConstantInbounds() {
+ var sum = 0;
+
+ for (var j = 0; j < indicesInbounds.length - 1; ++j) {
+ sum += string.charCodeAt(indicesInbounds[j]);
+ }
+
+ return sum;
+}
+
+new BenchmarkSuite('StringCodePointAtConstant', [3], [
+ new Benchmark('StringCodePointAtConstant', true, false, 0,
+ StringCodePointAtConstant),
+]);
+
+new BenchmarkSuite('StringCodePointAtNonConstant', [3], [
+ new Benchmark('StringCodePointAtNonConstant', true, false, 0,
+ StringCodePointAtNonConstant),
+]);
+
+new BenchmarkSuite('StringCodePointAtConstantInbounds', [3], [
+ new Benchmark('StringCodePointAtConstantInbounds', true, false, 0,
+ StringCodePointAtConstantInbounds),
+]);
+
+new BenchmarkSuite('StringCodePointAtNonConstantInbounds', [3], [
+ new Benchmark('StringCodePointAtNonConstantInbounds', true, false, 0,
+ StringCodePointAtNonConstantInbounds),
+]);
+
+const unicode_string = "qweräϠ�𝌆krefdäϠ�𝌆ccäϠ�𝌆";
+
+function StringCodePointAtConstant() {
+ var sum = 0;
+
+ for (var j = 0; j < indices.length - 1; ++j) {
+ sum += unicode_string.codePointAt(indices[j] | 0);
+ }
+
+ return sum;
+}
+
+function StringCodePointAtNonConstant() {
+ var sum = 0;
+
+ for (var j = 0; j < indices.length - 1; ++j) {
+ sum += unicode_string.codePointAt(indices[j]);
+ }
+
+ return sum;
+}
+
+function StringCodePointAtConstantInbounds() {
+ var sum = 0;
+
+ for (var j = 0; j < indicesInbounds.length - 1; ++j) {
+ sum += unicode_string.codePointAt(indicesInbounds[j] | 0);
+ }
+
+ return sum;
+}
+
+function StringCodePointAtNonConstantInbounds() {
+ var sum = 0;
+
+ for (var j = 0; j < indicesInbounds.length - 1; ++j) {
+ sum += unicode_string.codePointAt(indicesInbounds[j]);
+ }
+
+ return sum;
+}
diff --git a/src/v8/test/js-perf-test/Strings/string-substring.js b/src/v8/test/js-perf-test/Strings/string-substring.js
new file mode 100644
index 0000000..cde6fe6
--- /dev/null
+++ b/src/v8/test/js-perf-test/Strings/string-substring.js
@@ -0,0 +1,198 @@
+// Copyright 2017 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.
+
+const subjects = [
+ 'abcde', '123456', 'aqwsde', 'nbvveqxu', 'f03ks-120-3;jfkm;ajp3f',
+ 'sd-93u498thikefnow8y3-0rh1nalksfnwo8y3t19-3r8hoiefnw'
+];
+
+// Drop first element.
+
+function StringDropFirstSlice() {
+ var sum = "";
+
+ for (var j = 0; j < subjects.length; ++j) {
+ let s = subjects[j];
+ sum += s.slice(1);
+ }
+
+ return sum;
+}
+createSuiteWithWarmup('StringDropFirstSlice', 5, StringDropFirstSlice);
+
+function StringDropFirstSubstr() {
+ var sum = "";
+
+ for (var j = 0; j < subjects.length; ++j) {
+ let s = subjects[j];
+ sum += s.substr(1);
+ }
+
+ return sum;
+}
+createSuiteWithWarmup('StringDropFirstSubstr', 5, StringDropFirstSubstr);
+
+function StringDropFirstSubstring() {
+ var sum = "";
+
+ for (var j = 0; j < subjects.length; ++j) {
+ let s = subjects[j];
+ sum += s.substring(1);
+ }
+
+ return sum;
+}
+createSuiteWithWarmup('StringDropFirstSubstring', 5, StringDropFirstSubstring);
+
+// Take first element.
+
+function StringTakeFirstSlice() {
+ var sum = "";
+
+ for (var j = 0; j < subjects.length; ++j) {
+ let s = subjects[j];
+ sum += s.slice(0,1);
+ }
+
+ return sum;
+}
+createSuiteWithWarmup('StringTakeFirstSlice', 5, StringTakeFirstSlice);
+
+function StringTakeFirstSubstr() {
+ var sum = "";
+
+ for (var j = 0; j < subjects.length; ++j) {
+ let s = subjects[j];
+ sum += s.substr(0,1);
+ }
+
+ return sum;
+}
+createSuiteWithWarmup('StringTakeFirstSubstr', 5, StringTakeFirstSubstr);
+
+function StringTakeFirstSubstring() {
+ var sum = "";
+
+ for (var j = 0; j < subjects.length; ++j) {
+ let s = subjects[j];
+ sum += s.substring(0, 1);
+ }
+
+ return sum;
+}
+createSuiteWithWarmup('StringTakeFirstSubstring', 5, StringTakeFirstSubstring);
+
+// Drop last element.
+
+function StringDropLastSlice() {
+ var sum = "";
+
+ for (var j = 0; j < subjects.length; ++j) {
+ let s = subjects[j];
+ sum += s.slice(0, -1);
+ }
+
+ return sum;
+}
+createSuiteWithWarmup('StringDropLastSlice', 5, StringDropLastSlice);
+
+function StringDropLastSubstr() {
+ var sum = "";
+
+ for (var j = 0; j < subjects.length; ++j) {
+ let s = subjects[j];
+ sum += s.substr(0, s.length-1);
+ }
+
+ return sum;
+}
+createSuiteWithWarmup('StringDropLastSubstr', 5, StringDropLastSubstr);
+
+function StringDropLastSubstring() {
+ var sum = "";
+
+ for (var j = 0; j < subjects.length; ++j) {
+ let s = subjects[j];
+ sum += s.substring(0, s.length-1);
+ }
+
+ return sum;
+}
+createSuiteWithWarmup('StringDropLastSubstring', 5, StringDropLastSubstring);
+
+// Take last element.
+
+function StringTakeLastSlice() {
+ var sum = "";
+
+ for (var j = 0; j < subjects.length; ++j) {
+ let s = subjects[j];
+ sum += s.slice(-1);
+ }
+
+ return sum;
+}
+createSuiteWithWarmup('StringTakeLastSlice', 5, StringTakeLastSlice);
+
+function StringTakeLastSubstr() {
+ var sum = "";
+
+ for (var j = 0; j < subjects.length; ++j) {
+ let s = subjects[j];
+ sum += s.substr(-1);
+ }
+
+ return sum;
+}
+createSuiteWithWarmup('StringTakeLastSubstr', 5, StringTakeLastSubstr);
+
+function StringTakeLastSubstring() {
+ var sum = "";
+
+ for (var j = 0; j < subjects.length; ++j) {
+ let s = subjects[j];
+ sum += s.substring(s.length-1, s.length);
+ }
+
+ return sum;
+}
+createSuiteWithWarmup('StringTakeLastSubstring', 5, StringTakeLastSubstring);
+
+// Drop first and last.
+
+function StringDropFirstSlice() {
+ var sum = "";
+
+ for (var j = 0; j < subjects.length; ++j) {
+ let s = subjects[j];
+ sum += s.slice(1, -1);
+ }
+
+ return sum;
+}
+createSuiteWithWarmup('StringDropFirstSlice', 5, StringDropFirstSlice);
+
+function StringDropFirstSubstr() {
+ var sum = "";
+
+ for (var j = 0; j < subjects.length; ++j) {
+ let s = subjects[j]
+ sum += s.substr(1, s.length-2);
+ }
+
+ return sum;
+}
+createSuiteWithWarmup('StringDropFirstSubstr', 5, StringDropFirstSubstr);
+
+function StringDropFirstSubstring() {
+ var sum = "";
+
+ for (var j = 0; j < subjects.length; ++j) {
+ let s = subjects[j];
+ sum += s.substring(1, s.length-1);
+ }
+
+ return sum;
+}
+createSuiteWithWarmup('StringDropFirstSubstring', 5, StringDropFirstSubstring);
diff --git a/src/v8/test/js-perf-test/Strings/string-toLocaleCase.js b/src/v8/test/js-perf-test/Strings/string-toLocaleCase.js
new file mode 100644
index 0000000..67919fd
--- /dev/null
+++ b/src/v8/test/js-perf-test/Strings/string-toLocaleCase.js
@@ -0,0 +1,35 @@
+// Copyright 2019 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('StringToLocaleUpperCaseTR', [5], [
+ new Benchmark('StringToLocaleUpperCaseTR', false, false, 0,
+ StringToLocaleUpperCaseTR)
+]);
+new BenchmarkSuite('StringToLocaleLowerCaseTR', [5], [
+ new Benchmark('StringToLocaleLowerCaseTR', false, false, 0,
+ StringToLocaleLowerCaseTR),
+]);
+new BenchmarkSuite('StringToLocaleUpperCase', [5], [
+ new Benchmark('StringToLocaleUpperCase', false, false, 0,
+ StringToLocaleUpperCase)
+]);
+new BenchmarkSuite('StringToLocaleLowerCase', [5], [
+ new Benchmark('StringToLocaleLowerCase', false, false, 0,
+ StringToLocaleLowerCase),
+]);
+
+var shortString = "Îñţérñåţîöñåļîžåţîöñ Ļöçåļîžåţîöñ החןןם שםוןמ Γρεεκ ισ φθν 一二三";
+
+function StringToLocaleUpperCase() {
+ return shortString.toLocaleUpperCase();
+}
+function StringToLocaleLowerCase() {
+ return shortString.toLocaleLowerCase();
+}
+function StringToLocaleUpperCaseTR() {
+ return shortString.toLocaleUpperCase(["tr"]);
+}
+function StringToLocaleLowerCaseTR() {
+ return shortString.toLocaleLowerCase(["tr"]);
+}