Add js-perf-test for ES6 class default constructor
BUG=v8:3330 LOG=N TBR=dslomov@chromium.org Review URL: https://codereview.chromium.org/754523004 Cr-Commit-Position: refs/heads/master@{#25669}
This commit is contained in:
parent
66e2f60bf9
commit
f515e3635f
@ -8,6 +8,7 @@
|
||||
"results_regexp": "^%s\\-Classes\\(Score\\): (.+)$",
|
||||
"total": true,
|
||||
"tests": [
|
||||
{"name": "Super"}
|
||||
{"name": "Super"},
|
||||
{"name": "DefaultConstructor"}
|
||||
]
|
||||
}
|
||||
|
33
test/js-perf-test/Classes/default-constructor.js
Normal file
33
test/js-perf-test/Classes/default-constructor.js
Normal file
@ -0,0 +1,33 @@
|
||||
// Copyright 2014 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.
|
||||
'use strict';
|
||||
|
||||
var DefaultConstructorBenchmark = new BenchmarkSuite('DefaultConstructor',
|
||||
[100], [
|
||||
new Benchmark('NoSuperClass', false, false, 0, NoSuperClass),
|
||||
new Benchmark('WithSuperClass', false, false, 0, WithSuperClass),
|
||||
new Benchmark('WithSuperClassArguments', false, false, 0,
|
||||
WithSuperClassArguments),
|
||||
]);
|
||||
|
||||
|
||||
class BaseClass {}
|
||||
|
||||
|
||||
class DerivedClass extends BaseClass {}
|
||||
|
||||
|
||||
function NoSuperClass() {
|
||||
return new BaseClass();
|
||||
}
|
||||
|
||||
|
||||
function WithSuperClass() {
|
||||
return new DerivedClass();
|
||||
}
|
||||
|
||||
|
||||
function WithSuperClassArguments() {
|
||||
return new DerivedClass(0, 1, 2, 3, 4);
|
||||
}
|
@ -5,6 +5,7 @@
|
||||
|
||||
load('../base.js');
|
||||
load('super.js');
|
||||
load('default-constructor.js');
|
||||
|
||||
|
||||
var success = true;
|
||||
|
Loading…
Reference in New Issue
Block a user