Commit f39f76d6 authored by Santiago Aboy Solanes's avatar Santiago Aboy Solanes Committed by Commit Bot

[IC] Add LdaNamedProperty micro-benchmark tests

Change-Id: I154b7705fe9750ed16166c50a22cd16b0abc0425
Reviewed-on: https://chromium-review.googlesource.com/c/v8/v8/+/1687889
Commit-Queue: Santiago Aboy Solanes <solanes@chromium.org>
Reviewed-by: 's avatarRoss McIlroy <rmcilroy@chromium.org>
Cr-Commit-Position: refs/heads/master@{#62523}
parent db24e200
// 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 addBenchmark(name, test) {
new BenchmarkSuite(name, [1000],
[
new Benchmark(name, false, false, 0, test)
]);
}
addBenchmark('Smi-Value', smiValue);
addBenchmark('Prototype-Chain-Value', functionOnPrototypeValue);
// TODO(all): might be a good idea to also do with receivers: double, HeapObject
// with map, HeapObject, tagged, empty getter / accessor.
// Also, element keyed loads (in another file, probably?) both with strings and
// numbers for normal, cons,and sliced strings (for named properties).
// Also, monomorphic vs poly vs mega.
function smiValue() {
function constructSmi() {
this.smi = 0;
}
let o = new constructSmi();
for (var i = 0; i < 1000; ++i) {
o.smi; o.smi; o.smi; o.smi; o.smi; o.smi; o.smi; o.smi; o.smi; o.smi;
o.smi; o.smi; o.smi; o.smi; o.smi; o.smi; o.smi; o.smi; o.smi; o.smi;
o.smi; o.smi; o.smi; o.smi; o.smi; o.smi; o.smi; o.smi; o.smi; o.smi;
o.smi; o.smi; o.smi; o.smi; o.smi; o.smi; o.smi; o.smi; o.smi; o.smi;
o.smi; o.smi; o.smi; o.smi; o.smi; o.smi; o.smi; o.smi; o.smi; o.smi;
o.smi; o.smi; o.smi; o.smi; o.smi; o.smi; o.smi; o.smi; o.smi; o.smi;
o.smi; o.smi; o.smi; o.smi; o.smi; o.smi; o.smi; o.smi; o.smi; o.smi;
o.smi; o.smi; o.smi; o.smi; o.smi; o.smi; o.smi; o.smi; o.smi; o.smi;
o.smi; o.smi; o.smi; o.smi; o.smi; o.smi; o.smi; o.smi; o.smi; o.smi;
o.smi; o.smi; o.smi; o.smi; o.smi; o.smi; o.smi; o.smi; o.smi; o.smi;
}
}
function functionOnPrototypeValue() {
function objectWithPrototypeChain() {
}
objectWithPrototypeChain.prototype.__proto__ =
{__proto__:{__proto__:{__proto__:{f(){}}}}};
let o = new objectWithPrototypeChain();
for (var i = 0; i < 1000; ++i) {
o.f; o.f; o.f; o.f; o.f; o.f; o.f; o.f; o.f; o.f;
o.f; o.f; o.f; o.f; o.f; o.f; o.f; o.f; o.f; o.f;
o.f; o.f; o.f; o.f; o.f; o.f; o.f; o.f; o.f; o.f;
o.f; o.f; o.f; o.f; o.f; o.f; o.f; o.f; o.f; o.f;
o.f; o.f; o.f; o.f; o.f; o.f; o.f; o.f; o.f; o.f;
o.f; o.f; o.f; o.f; o.f; o.f; o.f; o.f; o.f; o.f;
o.f; o.f; o.f; o.f; o.f; o.f; o.f; o.f; o.f; o.f;
o.f; o.f; o.f; o.f; o.f; o.f; o.f; o.f; o.f; o.f;
o.f; o.f; o.f; o.f; o.f; o.f; o.f; o.f; o.f; o.f;
o.f; o.f; o.f; o.f; o.f; o.f; o.f; o.f; o.f; o.f;
}
}
......@@ -348,6 +348,17 @@
{"name": "Smi-Constant-ShiftRight"},
{"name": "Smi-Constant-ShiftRightLogical"}
]
},
{
"name": "LdaNamedProperty",
"main": "run.js",
"resources": [ "LdaNamedProperty.js" ],
"test_flags": [ "LdaNamedProperty" ],
"results_regexp": "^%s\\-BytecodeHandler\\(Score\\): (.+)$",
"tests": [
{"name": "Smi-Value"},
{"name": "Prototype-Chain-Value"}
]
}
]
}
......
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