node/deps/v8/test/js-perf-test/Object/assign.js
Ben Noordhuis 70d1f32f56 deps: update v8 to 4.4.63.9
Upgrade the bundled V8 and update code in src/ and lib/ to the new API.

Notable backwards incompatible changes are the removal of the smalloc
module and dropped support for CESU-8 decoding.  CESU-8 support can be
brought back if necessary by doing UTF-8 decoding ourselves.

This commit includes https://codereview.chromium.org/1192973004 to fix
a build error on python 2.6 systems.  The original commit log follows:

    Use optparse in js2c.py for python compatibility

    Without this change, V8 won't build on RHEL/CentOS 6 because the
    distro python is too old to know about the argparse module.

PR-URL: https://github.com/nodejs/io.js/pull/2022
Reviewed-By: Rod Vagg <rod@vagg.org>
Reviewed-By: Trevor Norris <trev.norris@gmail.com>
2015-08-04 11:56:14 -07:00

82 lines
1.9 KiB
JavaScript

// 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;
}