blob: f67bf2530d6bd89634a5648208ffb5a6bd53e628 [file] [log] [blame]
Ben Murdochb0fe1622011-05-05 13:52:32 +01001// Copyright 2010 the V8 project authors. All rights reserved.
Ben Murdochb8a8cc12014-11-26 15:28:44 +00002// Use of this source code is governed by a BSD-style license that can be
3// found in the LICENSE file.
Ben Murdochb0fe1622011-05-05 13:52:32 +01004
5#ifndef V8_V8_TEST_H_
6#define V8_V8_TEST_H_
7
Ben Murdoch4a90d5f2016-03-22 12:00:34 +00008#include "v8.h" // NOLINT(build/include)
Ben Murdochb0fe1622011-05-05 13:52:32 +01009
Ben Murdochb0fe1622011-05-05 13:52:32 +010010/**
11 * Testing support for the V8 JavaScript engine.
12 */
13namespace v8 {
14
Ben Murdochb8a8cc12014-11-26 15:28:44 +000015class V8_EXPORT Testing {
Ben Murdochb0fe1622011-05-05 13:52:32 +010016 public:
17 enum StressType {
18 kStressTypeOpt,
19 kStressTypeDeopt
20 };
21
22 /**
23 * Set the type of stressing to do. The default if not set is kStressTypeOpt.
24 */
25 static void SetStressRunType(StressType type);
26
27 /**
28 * Get the number of runs of a given test that is required to get the full
29 * stress coverage.
30 */
31 static int GetStressRuns();
32
33 /**
34 * Indicate the number of the run which is about to start. The value of run
35 * should be between 0 and one less than the result from GetStressRuns()
36 */
37 static void PrepareStressRun(int run);
Steve Block44f0eee2011-05-26 01:26:41 +010038
39 /**
40 * Force deoptimization of all functions.
41 */
Ben Murdoch4a90d5f2016-03-22 12:00:34 +000042 static void DeoptimizeAll(Isolate* isolate);
Ben Murdochb0fe1622011-05-05 13:52:32 +010043};
44
45
46} // namespace v8
47
Ben Murdochb0fe1622011-05-05 13:52:32 +010048#endif // V8_V8_TEST_H_