Commit 0db46e6a authored by Z Nguyen-Huu's avatar Z Nguyen-Huu Committed by Commit Bot

add new micro-benchmark of HasOwnProperty for frozen objects

Bug: v8:6831
Change-Id: I906dcc363620fda97f00cb02b68c3e393471076d
Reviewed-on: https://chromium-review.googlesource.com/c/v8/v8/+/1651144Reviewed-by: 's avatarBenedikt Meurer <bmeurer@chromium.org>
Reviewed-by: 's avatarToon Verwaest <verwaest@chromium.org>
Commit-Queue: Z Nguyen-Huu <duongn@microsoft.com>
Cr-Commit-Position: refs/heads/master@{#62093}
parent aff3e0fb
......@@ -570,7 +570,8 @@
"resources": [
"array-indexof-includes.js",
"spread-call.js",
"tagged-template.js"
"tagged-template.js",
"has-own-property.js"
],
"results_regexp": "^%s\\-Numbers\\(Score\\): (.+)$",
"tests": [
......@@ -580,7 +581,8 @@
{"name": "ArrayIncludes"},
{"name": "ApplySpreadLiteral"},
{"name": "SpreadCall"},
{"name": "SpreadCallSpreadLiteral"}
{"name": "SpreadCallSpreadLiteral"},
{"name": "HasOwnProperty"}
]
},
{
......
// 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 driver(n) {
let result = 0;
for (var i=0;i<n;i++) {
result += frozenArray.hasOwnProperty(''+i)==-1?0:1;
}
return result;
}
function HasOwnProperty() {
driver(1e4);
}
function HasOwnPropertyWarmUp() {
driver(1e1);
driver(1e2);
driver(1e3);
}
createSuite('HasOwnProperty', 10, HasOwnProperty, HasOwnPropertyWarmUp);
......@@ -5,6 +5,7 @@ load('../base.js');
load('tagged-template.js');
load('array-indexof-includes.js');
load('spread-call.js');
load('has-own-property.js');
function PrintResult(name, result) {
console.log(name);
......
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