summaryrefslogtreecommitdiff
path: root/benchmark/misc/v8-bench.js
blob: 8bf49f3f611804a14b881f36bb26c4e7020bc081 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
// compare with "google-chrome deps/v8/benchmarks/run.html"
var fs = require('fs');
var path = require('path');
var vm = require('vm');

var dir = path.join(__dirname, '..', '..', 'deps', 'v8', 'benchmarks');

global.print = function(s) {
  if (s === '----') return;
  console.log('misc/v8_bench.js %s', s);
};

global.load = function (x) {
  var source = fs.readFileSync(path.join(dir, x), 'utf8');
  vm.runInThisContext(source, x);
}

load('run.js');