Upload Kmake

This commit is contained in:
Gorochu
2026-05-26 23:36:42 -07:00
parent ba051b2f74
commit 555ec72358
41615 changed files with 13344630 additions and 1 deletions

View File

@ -0,0 +1,33 @@
{
"name": "ObjectTests",
"run_count": 5,
"run_count_android_arm": 3,
"run_count_android_arm64": 3,
"timeout": 120,
"units": "score",
"total": true,
"resources": ["base.js"],
"tests": [
{
"name": "Object",
"path": ["."],
"main": "run.js",
"flags": ["--harmony"],
"resources": [
"assign.js",
"create.js",
"entries.js",
"values.js"
],
"results_regexp": "^%s\\-Object\\(Score\\): (.+)$",
"tests": [
{"name": "Assign"},
{"name": "Create"},
{"name": "Entries"},
{"name": "EntriesMegamorphic"},
{"name": "Values"},
{"name": "ValuesMegamorphic"}
]
}
]
}

View File

@ -0,0 +1,81 @@
// 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.
new BenchmarkSuite('Assign', [1000], [
new Benchmark('BasicAssign1', false, false, 0,
BasicAssign1, BasicAssign1Setup, BasicAssign1TearDown),
new Benchmark('BasicAssign3', false, false, 0,
BasicAssign3, BasicAssign3Setup, BasicAssign3TearDown),
new Benchmark('BasicAssignNull3', false, false, 0,
BasicAssignNull3, BasicAssignNull3Setup,
BasicAssignNull3TearDown),
]);
var object;
var src1;
var src2;
var src3;
var obj1;
var obj2;
// ----------------------------------------------------------------------------
function BasicAssign1Setup() {
object = {};
obj1 = {};
obj2 = {};
src1 = { id: "6930530530", obj1: obj1, obj2: obj2 };
}
function BasicAssign1() {
Object.assign(object, src1);
}
function BasicAssign1TearDown() {
return object.id === src1.id &&
object.obj1 === obj1 &&
object.obj2 === obj2;
}
// ----------------------------------------------------------------------------
function BasicAssign3Setup() {
object = {};
obj1 = {};
obj2 = {};
src1 = { id: "6930530530" };
src2 = { obj1: obj1 };
src3 = { obj2: obj2 };
}
function BasicAssign3() {
Object.assign(object, src1, src2, src3);
}
function BasicAssign3TearDown() {
return object.id === src1.id &&
object.obj1 === src2 &&
object.obj2 === src3;
}
// ----------------------------------------------------------------------------
function BasicAssignNull3Setup() {
object = {};
obj1 = {};
obj2 = {};
src1 = { id: "6930530530" };
src2 = null;
src3 = { obj1: obj1, obj2: obj2 };
}
function BasicAssignNull3() {
Object.assign(object, src1, src2, src3);
}
function BasicAssignNull3TearDown() {
return object.id === src1.id &&
object.obj1 === src2 &&
object.obj2 === src3;
}

View File

@ -0,0 +1,70 @@
// Copyright 2016 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 shallowClone(object) {
return Object.create(object.__proto__,
Object.getOwnPropertyDescriptors(object));
}
function makeSlowCopy(object) {
object = shallowClone(object);
object.__foo__ = 1;
delete object.__foo__;
return object;
}
function convertToPropertyDescriptors(dict) {
for (var key in dict) {
var propertiesObject = dict[key];
dict[key] = Object.getOwnPropertyDescriptors(propertiesObject);
}
return dict;
}
var properties_5 = { a:1, b:2, c:3, d:4, e:5 };
var TEST_PROPERTIES = convertToPropertyDescriptors({
empty: {},
array_5: [1, 2, 3, 4, 5],
properties_5: properties_5,
properties_10: { a:1, b:2, c:3, d:4, e:5, f:6, g:7, h:8, i:9, j:10 },
properties_dict: makeSlowCopy(properties_5)
});
var TEST_PROTOTYPES = {
null: null,
empty: {},
'Object.prototype': Object.prototype,
'Array.prototype': Array.prototype
};
// ----------------------------------------------------------------------------
var testFunction = () => {
return Object.create(prototype, properties);
}
function createTestFunction(prototype, properties) {
// Force a new function for each test-object to avoid side-effects due to ICs.
var random_comment = "\n// random comment" + Math.random() + "\n";
return eval(random_comment + testFunction.toString());
}
// ----------------------------------------------------------------------------
var benchmarks = []
for (var proto_name in TEST_PROTOTYPES) {
var prototype = TEST_PROTOTYPES[proto_name];
for (var prop_name in TEST_PROPERTIES) {
var properties = TEST_PROPERTIES[prop_name];
var name = 'Create proto:' + proto_name + " properties:" + prop_name;
benchmarks.push(
new Benchmark(name, false, false, 0,
createTestFunction(prototype, properties)));
}
}
new BenchmarkSuite('Create', [1000], benchmarks);

View File

@ -0,0 +1,75 @@
// Copyright 2016 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('Entries', [1000], [
new Benchmark('Basic', false, false, 0, Basic, BasicSetup, BasicTearDown)
]);
var object;
var expected;
var result;
var symbol1;
function Basic() {
result = Object.entries(object);
}
function BasicSetup() {
result = undefined;
symbol1 = Symbol('test');
object = { a: 10 };
object[26.0] = 'third';
object.b = 72;
object[symbol1] = 'TEST';
Object.defineProperty(object, 'not-enumerable', {
enumerable: false, value: 'nope', writable: true, configurable: true });
}
function BasicTearDown() {
result = result.map(entry => `[${[String(entry[0]), String(entry[1])]}]`);
return result.length === 3 &&
result.join(', ') === '[a, 10], [26.0, third], [b, 72]';
}
// ----------------------------------------------------------------------------
new BenchmarkSuite('EntriesMegamorphic', [1000], [
new Benchmark('BasicMegamorphic', false, false, 0, BasicMegamorphic,
BasicMegamorphicSetup, BasicMegamorphicTearDown)
]);
function BasicMegamorphic() {
for (var i = 0; i < object.length; ++i) {
result[i] = Object.entries(object[i]);
}
}
function BasicMegamorphicSetup() {
// Create 1k objects with different maps.
object = [];
expected = [];
result = [];
for (var i=0; i<1000; i++) {
var obj = {};
var exp = [];
for (var j=0; j<10; j++) {
obj['key-'+i+'-'+j] = 'property-'+i+'-'+j;
exp[j] = ['key-'+i+'-'+j, 'property-'+i+'-'+j];
}
object[i] = obj;
expected[i] = exp;
}
}
function BasicMegamorphicTearDown() {
if (JSON.stringify(expected) !== JSON.stringify(result)) {
throw new Error("FAILURE");
}
object = result = expected = undefined;
return true;
}

30
deps/v8/test/js-perf-test/Object/run.js vendored Normal file
View File

@ -0,0 +1,30 @@
// 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.
d8.file.execute('../base.js');
d8.file.execute('assign.js');
d8.file.execute('create.js');
d8.file.execute('entries.js');
d8.file.execute('values.js');
var success = true;
function PrintResult(name, result) {
print(name + '-Object(Score): ' + result);
}
function PrintError(name, error) {
PrintResult(name, error);
success = false;
}
BenchmarkSuite.config.doWarmup = undefined;
BenchmarkSuite.config.doDeterministic = undefined;
BenchmarkSuite.RunSuites({ NotifyResult: PrintResult,
NotifyError: PrintError });

View File

@ -0,0 +1,75 @@
// Copyright 2016 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('Values', [1000], [
new Benchmark('Basic', false, false, 0, Basic, BasicSetup, BasicTearDown),
]);
var object;
var expected;
var result;
var symbol1;
function Basic() {
result = Object.values(object);
}
function BasicSetup() {
result = undefined;
symbol1 = Symbol('test');
object = { a: 10 };
object[26.0] = 'third';
object.b = 72;
object[symbol1] = 'TEST';
Object.defineProperty(object, 'not-enumerable', {
enumerable: false, value: 'nope', writable: true, configurable: true });
}
function BasicTearDown() {
return result.length === 3 && result[0] === 10 && result[1] === 'third' &&
result[2] === 72;
}
// ----------------------------------------------------------------------------
new BenchmarkSuite('ValuesMegamorphic', [1000], [
new Benchmark('BasicMegamorphic', false, false, 0, BasicMegamorphic,
BasicMegamorphicSetup, BasicMegamorphicTearDown)
]);
function BasicMegamorphic() {
for (var i = 0; i < object.length; ++i) {
result[i] = Object.values(object[i]);
}
}
function BasicMegamorphicSetup() {
// Create 1k objects with different maps.
object = [];
expected = [];
result = [];
for (var i=0; i<1000; i++) {
var obj = {};
var exp = [];
for (var j=0; j<10; j++) {
obj['key-'+i+'-'+j] = 'property-'+i+'-'+j;
exp[j] = 'property-'+i+'-'+j;
}
object[i] = obj;
expected[i] = exp;
}
}
function BasicMegamorphicTearDown() {
if (JSON.stringify(expected) !== JSON.stringify(result)) {
throw new Error("FAILURE");
}
object = result = expected = undefined;
return true;
}