v8-testing.h 1.01 KB
Newer Older
1
// Copyright 2010 the V8 project authors. All rights reserved.
2 3
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.
4 5 6 7 8 9 10 11 12 13 14

#ifndef V8_V8_TEST_H_
#define V8_V8_TEST_H_

#include "v8.h"

/**
 * Testing support for the V8 JavaScript engine.
 */
namespace v8 {

15
class V8_EXPORT Testing {
16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37
 public:
  enum StressType {
    kStressTypeOpt,
    kStressTypeDeopt
  };

  /**
   * Set the type of stressing to do. The default if not set is kStressTypeOpt.
   */
  static void SetStressRunType(StressType type);

  /**
   * Get the number of runs of a given test that is required to get the full
   * stress coverage.
   */
  static int GetStressRuns();

  /**
   * Indicate the number of the run which is about to start. The value of run
   * should be between 0 and one less than the result from GetStressRuns()
   */
  static void PrepareStressRun(int run);
38 39 40 41 42

  /**
   * Force deoptimization of all functions.
   */
  static void DeoptimizeAll();
43 44 45 46 47 48
};


}  // namespace v8

#endif  // V8_V8_TEST_H_