Commit a6b38d81 authored by Marja Hölttä's avatar Marja Hölttä Committed by Commit Bot

[super property speed] Add js-perf-tests for super property access

Bug: v8:9237
No-Try: True
Change-Id: Ic1bba1e0f5584350217c3971dfcc769c86beb1fd
Reviewed-on: https://chromium-review.googlesource.com/c/v8/v8/+/2366694
Commit-Queue: Marja Hölttä <marja@chromium.org>
Reviewed-by: 's avatarIgor Sheludko <ishell@chromium.org>
Reviewed-by: 's avatarPeter Marshall <petermarshall@chromium.org>
Cr-Commit-Position: refs/heads/master@{#69538}
parent 23906bcd
{
"owners": ["marja@chromium.org"],
"name": "SuperIC",
"run_count": 3,
"run_count_arm": 1,
"run_count_arm64": 1,
"timeout": 120,
"timeout_arm64": 240,
"units": "score",
"total": true,
"resources": ["base.js"],
"tests": [
{
"name": "SuperIC-baseline-noopt",
"path": ["SuperIC"],
"flags": ["--noopt"],
"results_regexp": "^%s\\(Score\\): (.+)$",
"tests": [
{
"name": "Monomorphic",
"main": "run.js",
"resources": ["monomorphic.js"],
"test_flags": ["monomorphic"]
},
{
"name": "Monomorphic-MegaReceivers",
"main": "run.js",
"resources": ["monomorphic-mega-receivers.js"],
"test_flags": ["monomorphic-mega-receivers"]
},
{
"name": "Polymorphic-Mixin",
"main": "run.js",
"resources": ["polymorphic-mixin.js"],
"test_flags": ["polymorphic-mixin"]
},
{
"name": "Polymorphic-Mixin-MegaReceivers",
"main": "run.js",
"resources": ["polymorphic-mixin-mega-receivers.js"],
"test_flags": ["polymorphic-mixin-mega-receivers"]
},
{
"name": "Megamorphic-Mixin",
"main": "run.js",
"resources": ["megamorphic-mixin.js"],
"test_flags": ["megamorphic-mixin"]
},
{
"name": "Monomorphic-Getter",
"main": "run.js",
"resources": ["monomorphic-getter.js"],
"test_flags": ["monomorphic-getter"]
},
{
"name": "Monomorphic-MegaReceivers-Getter",
"main": "run.js",
"resources": ["monomorphic-mega-receivers-getter.js"],
"test_flags": ["monomorphic-mega-receivers-getter"]
},
{
"name": "Polymorphic-Mixin-Getter",
"main": "run.js",
"resources": ["polymorphic-mixin-getter.js"],
"test_flags": ["polymorphic-mixin-getter"]
},
{
"name": "Polymorphic-Mixin-MegaReceivers-Getter",
"main": "run.js",
"resources": ["polymorphic-mixin-mega-receivers-getter.js"],
"test_flags": ["polymorphic-mixin-mega-receivers-getter"]
},
{
"name": "Megamorphic-Mixin-Getter",
"main": "run.js",
"resources": ["megamorphic-mixin-getter.js"],
"test_flags": ["megamorphic-mixin-getter"]
}
]
},
{
"name": "SuperIC-baseline-opt",
"path": ["SuperIC"],
"flags": [],
"results_regexp": "^%s\\(Score\\): (.+)$",
"tests": [
{
"name": "Monomorphic",
"main": "run.js",
"resources": ["monomorphic.js"],
"test_flags": ["monomorphic"]
},
{
"name": "Monomorphic-MegaReceivers",
"main": "run.js",
"resources": ["monomorphic-mega-receivers.js"],
"test_flags": ["monomorphic-mega-receivers"]
},
{
"name": "Polymorphic-Mixin",
"main": "run.js",
"resources": ["polymorphic-mixin.js"],
"test_flags": ["polymorphic-mixin"]
},
{
"name": "Polymorphic-Mixin-MegaReceivers",
"main": "run.js",
"resources": ["polymorphic-mixin-mega-receivers.js"],
"test_flags": ["polymorphic-mixin-mega-receivers"]
},
{
"name": "Megamorphic-Mixin",
"main": "run.js",
"resources": ["megamorphic-mixin.js"],
"test_flags": ["megamorphic-mixin"]
},
{
"name": "Monomorphic-Getter",
"main": "run.js",
"resources": ["monomorphic-getter.js"],
"test_flags": ["monomorphic-getter"]
},
{
"name": "Monomorphic-MegaReceivers-Getter",
"main": "run.js",
"resources": ["monomorphic-mega-receivers-getter.js"],
"test_flags": ["monomorphic-mega-receivers-getter"]
},
{
"name": "Polymorphic-Mixin-Getter",
"main": "run.js",
"resources": ["polymorphic-mixin-getter.js"],
"test_flags": ["polymorphic-mixin-getter"]
},
{
"name": "Polymorphic-Mixin-MegaReceivers-Getter",
"main": "run.js",
"resources": ["polymorphic-mixin-mega-receivers-getter.js"],
"test_flags": ["polymorphic-mixin-mega-receivers-getter"]
},
{
"name": "Megamorphic-Mixin-Getter",
"main": "run.js",
"resources": ["megamorphic-mixin-getter.js"],
"test_flags": ["megamorphic-mixin-getter"]
}
]
},
{
"name": "SuperIC-noopt",
"path": ["SuperIC"],
"flags": ["--noopt", "--super-ic"],
"results_regexp": "^%s\\(Score\\): (.+)$",
"tests": [
{
"name": "Monomorphic",
"main": "run.js",
"resources": ["monomorphic.js"],
"test_flags": ["monomorphic"]
},
{
"name": "Monomorphic-MegaReceivers",
"main": "run.js",
"resources": ["monomorphic-mega-receivers.js"],
"test_flags": ["monomorphic-mega-receivers"]
},
{
"name": "Polymorphic-Mixin",
"main": "run.js",
"resources": ["polymorphic-mixin.js"],
"test_flags": ["polymorphic-mixin"]
},
{
"name": "Polymorphic-Mixin-MegaReceivers",
"main": "run.js",
"resources": ["polymorphic-mixin-mega-receivers.js"],
"test_flags": ["polymorphic-mixin-mega-receivers"]
},
{
"name": "Megamorphic-Mixin",
"main": "run.js",
"resources": ["megamorphic-mixin.js"],
"test_flags": ["megamorphic-mixin"]
},
{
"name": "Monomorphic-Getter",
"main": "run.js",
"resources": ["monomorphic-getter.js"],
"test_flags": ["monomorphic-getter"]
},
{
"name": "Monomorphic-MegaReceivers-Getter",
"main": "run.js",
"resources": ["monomorphic-mega-receivers-getter.js"],
"test_flags": ["monomorphic-mega-receivers-getter"]
},
{
"name": "Polymorphic-Mixin-Getter",
"main": "run.js",
"resources": ["polymorphic-mixin-getter.js"],
"test_flags": ["polymorphic-mixin-getter"]
},
{
"name": "Polymorphic-Mixin-MegaReceivers-Getter",
"main": "run.js",
"resources": ["polymorphic-mixin-mega-receivers-getter.js"],
"test_flags": ["polymorphic-mixin-mega-receivers-getter"]
},
{
"name": "Megamorphic-Mixin-Getter",
"main": "run.js",
"resources": ["megamorphic-mixin-getter.js"],
"test_flags": ["megamorphic-mixin-getter"]
}
]
},
{
"name": "SuperIC-opt",
"path": ["SuperIC"],
"flags": ["--super-ic"],
"results_regexp": "^%s\\(Score\\): (.+)$",
"tests": [
{
"name": "Monomorphic",
"main": "run.js",
"resources": ["monomorphic.js"],
"test_flags": ["monomorphic"]
},
{
"name": "Monomorphic-MegaReceivers",
"main": "run.js",
"resources": ["monomorphic-mega-receivers.js"],
"test_flags": ["monomorphic-mega-receivers"]
},
{
"name": "Polymorphic-Mixin",
"main": "run.js",
"resources": ["polymorphic-mixin.js"],
"test_flags": ["polymorphic-mixin"]
},
{
"name": "Polymorphic-Mixin-MegaReceivers",
"main": "run.js",
"resources": ["polymorphic-mixin-mega-receivers.js"],
"test_flags": ["polymorphic-mixin-mega-receivers"]
},
{
"name": "Megamorphic-Mixin",
"main": "run.js",
"resources": ["megamorphic-mixin.js"],
"test_flags": ["megamorphic-mixin"]
},
{
"name": "Monomorphic-Getter",
"main": "run.js",
"resources": ["monomorphic-getter.js"],
"test_flags": ["monomorphic-getter"]
},
{
"name": "Monomorphic-MegaReceivers-Getter",
"main": "run.js",
"resources": ["monomorphic-mega-receivers-getter.js"],
"test_flags": ["monomorphic-mega-receivers-getter"]
},
{
"name": "Polymorphic-Mixin-Getter",
"main": "run.js",
"resources": ["polymorphic-mixin-getter.js"],
"test_flags": ["polymorphic-mixin-getter"]
},
{
"name": "Polymorphic-Mixin-MegaReceivers-Getter",
"main": "run.js",
"resources": ["polymorphic-mixin-mega-receivers-getter.js"],
"test_flags": ["polymorphic-mixin-mega-receivers-getter"]
},
{
"name": "Megamorphic-Mixin-Getter",
"main": "run.js",
"resources": ["megamorphic-mixin-getter.js"],
"test_flags": ["megamorphic-mixin-getter"]
}
]
}
]
}
// Copyright 2020 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 DETERMINISTIC_RUNS = 10000;
new BenchmarkSuite('Megamorphic-Mixin-Getter', [1000], [
new Benchmark('Megamorphic-Mixin-Getter', false, false, DETERMINISTIC_RUNS,
runBenchmark)
]);
function createSubclass() {
class A {
get super_prop() {
return 10;
}
};
class B extends A {
test() {
return super.super_prop;
}
};
return B;
}
const NO_CLASSES = 10;
let objects = [];
for (let i = 0; i < NO_CLASSES; ++i) {
const klass = createSubclass();
objects.push(new klass());
}
let ix = 0;
const EXPECTED_VALUE = 10;
function runBenchmark() {
const r = objects[ix].test();
if (r != EXPECTED_VALUE) {
throw new Error("Test error");
}
if (++ix == objects.length) {
ix = 0;
}
}
// Copyright 2020 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 DETERMINISTIC_RUNS = 10000;
new BenchmarkSuite('Megamorphic-Mixin', [1000], [
new Benchmark('Megamorphic-Mixin', false, false, DETERMINISTIC_RUNS,
runBenchmark)
]);
function createSubclass() {
class A { };
A.prototype.super_prop = 10;
class B extends A {
test() {
return super.super_prop;
}
};
return B;
}
const NO_CLASSES = 10;
let objects = [];
for (let i = 0; i < NO_CLASSES; ++i) {
const klass = createSubclass();
objects.push(new klass());
}
let ix = 0;
const EXPECTED_VALUE = 10;
function runBenchmark() {
const r = objects[ix].test();
if (r != EXPECTED_VALUE) {
throw new Error("Test error");
}
if (++ix == objects.length) {
ix = 0;
}
}
// Copyright 2020 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 DETERMINISTIC_RUNS = 10000;
new BenchmarkSuite('Monomorphic-Getter', [1000], [
new Benchmark('Monomorphic-Getter', false, false, DETERMINISTIC_RUNS, runBenchmark)
]);
class A {
get super_prop() {
return 10;
}
};
class B extends A {
test() {
return super.super_prop;
}
};
const objects = [new B(), new B(), new B(), new B()];
let ix = 0;
const EXPECTED_VALUE = 10;
function runBenchmark() {
const r = objects[ix].test();
if (r != EXPECTED_VALUE) {
throw new Error("Test error");
}
if (++ix == objects.length) {
ix = 0;
}
}
// Copyright 2020 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 DETERMINISTIC_RUNS = 10000;
new BenchmarkSuite('Monomorphic-MegaReceivers-Getter', [1000], [
new Benchmark('Monomorphic-MegaReceivers-Getter', false, false, DETERMINISTIC_RUNS,
runBenchmark)
]);
class A {
get super_prop() {
return 10;
}
};
class B extends A {
test() {
return super.super_prop;
}
};
class C0 extends B { };
class C1 extends B { };
class C2 extends B { };
class C3 extends B { };
class C4 extends B { };
class C5 extends B { };
class C6 extends B { };
class C7 extends B { };
class C8 extends B { };
class C9 extends B { };
const objects = [
new C0(),
new C1(),
new C2(),
new C3(),
new C4(),
new C5(),
new C6(),
new C7(),
new C8(),
new C9(),
];
let ix = 0;
const EXPECTED_VALUE = 10;
function runBenchmark() {
const r = objects[ix].test();
if (r != EXPECTED_VALUE) {
throw new Error("Test error");
}
if (++ix == objects.length) {
ix = 0;
}
}
// Copyright 2020 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 DETERMINISTIC_RUNS = 10000;
new BenchmarkSuite('Monomorphic-MegaReceivers', [1000], [
new Benchmark('Monomorphic-MegaReceivers', false, false, DETERMINISTIC_RUNS,
runBenchmark)
]);
class A { };
A.prototype.super_prop = 10;
class B extends A {
test() {
return super.super_prop;
}
};
class C0 extends B { };
class C1 extends B { };
class C2 extends B { };
class C3 extends B { };
class C4 extends B { };
class C5 extends B { };
class C6 extends B { };
class C7 extends B { };
class C8 extends B { };
class C9 extends B { };
const objects = [
new C0(),
new C1(),
new C2(),
new C3(),
new C4(),
new C5(),
new C6(),
new C7(),
new C8(),
new C9(),
];
let ix = 0;
const EXPECTED_VALUE = 10;
function runBenchmark() {
const r = objects[ix].test();
if (r != EXPECTED_VALUE) {
throw new Error("Test error");
}
if (++ix == objects.length) {
ix = 0;
}
}
// Copyright 2020 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 DETERMINISTIC_RUNS = 10000;
new BenchmarkSuite('Monomorphic', [1000], [
new Benchmark('Monomorphic', false, false, DETERMINISTIC_RUNS, runBenchmark)
]);
class A { };
A.prototype.super_prop = 10;
class B extends A {
test() {
return super.super_prop;
}
};
const objects = [new B(), new B(), new B(), new B()];
let ix = 0;
const EXPECTED_VALUE = 10;
function runBenchmark() {
const r = objects[ix].test();
if (r != EXPECTED_VALUE) {
throw new Error("Test error");
}
if (++ix == objects.length) {
ix = 0;
}
}
// Copyright 2020 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 DETERMINISTIC_RUNS = 10000;
new BenchmarkSuite('Polymorphic-Mixin-Getter', [1000], [
new Benchmark('Polymorphic-Mixin-Getter', false, false, DETERMINISTIC_RUNS,
runBenchmark)
]);
function createSubclass() {
class A {
get super_prop() {
return 10;
}
};
class B extends A {
test() {
return super.super_prop;
}
};
return B;
}
const b1 = createSubclass();
const b2 = createSubclass();
const objects = [
new b1(),
new b2()
];
let ix = 0;
const EXPECTED_VALUE = 10;
function runBenchmark() {
const r = objects[ix].test();
if (r != EXPECTED_VALUE) {
throw new Error("Test error");
}
if (++ix == objects.length) {
ix = 0;
}
}
// Copyright 2020 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 DETERMINISTIC_RUNS = 10000;
new BenchmarkSuite('Polymorphic-Mixin-MegaReceivers-Getter', [1000], [
new Benchmark('Polymorphic-Mixin-MegaReceivers-Getter', false, false,
DETERMINISTIC_RUNS, runBenchmark)
]);
function createSubclass() {
class A {
get super_prop() {
return 10;
}
};
class B extends A {
test() {
return super.super_prop;
}
};
return B;
}
const b1 = createSubclass();
const b2 = createSubclass();
class C0 extends b1 { };
class C1 extends b2 { };
class C2 extends b1 { };
class C3 extends b2 { };
class C4 extends b1 { };
class C5 extends b2 { };
class C6 extends b1 { };
class C7 extends b2 { };
class C8 extends b1 { };
class C9 extends b2 { };
const objects = [
new C0(),
new C1(),
new C2(),
new C3(),
new C4(),
new C5(),
new C6(),
new C7(),
new C8(),
new C9(),
];
let ix = 0;
const EXPECTED_VALUE = 10;
function runBenchmark() {
const r = objects[ix].test();
if (r != EXPECTED_VALUE) {
throw new Error("Test error");
}
if (++ix == objects.length) {
ix = 0;
}
}
// Copyright 2020 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 DETERMINISTIC_RUNS = 10000;
new BenchmarkSuite('Polymorphic-Mixin-MegaReceivers', [1000], [
new Benchmark('Polymorphic-Mixin-MegaReceivers', false, false,
DETERMINISTIC_RUNS, runBenchmark)
]);
function createSubclass() {
class A { };
A.prototype.super_prop = 10;
class B extends A {
test() {
return super.super_prop;
}
};
return B;
}
const b1 = createSubclass();
const b2 = createSubclass();
class C0 extends b1 { };
class C1 extends b2 { };
class C2 extends b1 { };
class C3 extends b2 { };
class C4 extends b1 { };
class C5 extends b2 { };
class C6 extends b1 { };
class C7 extends b2 { };
class C8 extends b1 { };
class C9 extends b2 { };
const objects = [
new C0(),
new C1(),
new C2(),
new C3(),
new C4(),
new C5(),
new C6(),
new C7(),
new C8(),
new C9(),
];
let ix = 0;
const EXPECTED_VALUE = 10;
function runBenchmark() {
const r = objects[ix].test();
if (r != EXPECTED_VALUE) {
throw new Error("Test error");
}
if (++ix == objects.length) {
ix = 0;
}
}
// Copyright 2020 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 DETERMINISTIC_RUNS = 10000;
new BenchmarkSuite('Polymorphic-Mixin', [1000], [
new Benchmark('Polymorphic-Mixin', false, false, DETERMINISTIC_RUNS,
runBenchmark)
]);
function createSubclass() {
class A { };
A.prototype.super_prop = 10;
class B extends A {
test() {
return super.super_prop;
}
};
return B;
}
const b1 = createSubclass();
const b2 = createSubclass();
const objects = [
new b1(),
new b2()
];
let ix = 0;
const EXPECTED_VALUE = 10;
function runBenchmark() {
const r = objects[ix].test();
if (r != EXPECTED_VALUE) {
throw new Error("Test error");
}
if (++ix == objects.length) {
ix = 0;
}
}
// Copyright 2020 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.
load('../base.js');
load(arguments[0] + '.js');
var success = true;
function PrintResult(name, result) {
print(name + '(Score): ' + result);
}
function PrintError(name, error) {
PrintResult(name, error);
success = false;
}
BenchmarkSuite.config.doWarmup = false;
BenchmarkSuite.config.doDeterministic = true;
BenchmarkSuite.RunSuites({NotifyResult: PrintResult, NotifyError: PrintError});
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment