run.js 996 Bytes
Newer Older
1 2 3 4 5 6
// Copyright 2017 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.

load('../base.js');

7 8
let listener = null;

9
load('debugger.js');
10
load('runtime.js');
11

12 13
let success = true;
let lastId = 0;
14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32

function PrintResult(name, result) {
  print(name + '-Inspector(Score): ' + result);
}

function PrintStep(name) {}

function PrintError(name, error) {
  PrintResult(name, error);
  success = false;
}


BenchmarkSuite.config.doWarmup = undefined;
BenchmarkSuite.config.doDeterministic = undefined;

BenchmarkSuite.RunSuites({ NotifyResult: PrintResult,
                           NotifyError: PrintError,
                           NotifyStep: PrintStep });
33 34 35 36 37 38 39 40

function SendMessage(method, params) {
  let obj = {id: ++lastId, method: method};
  if (params) {
    obj.params = params;
  }
  send(JSON.stringify(obj));
}
41 42 43 44 45 46

function receive(message) {
  if (listener) {
    listener(JSON.parse(message));
  }
}