Ben Murdoch | b0fe162 | 2011-05-05 13:52:32 +0100 | [diff] [blame] | 1 | // Copyright 2010 the V8 project authors. All rights reserved. |
Ben Murdoch | b8a8cc1 | 2014-11-26 15:28:44 +0000 | [diff] [blame] | 2 | // Use of this source code is governed by a BSD-style license that can be |
| 3 | // found in the LICENSE file. |
Ben Murdoch | b0fe162 | 2011-05-05 13:52:32 +0100 | [diff] [blame] | 4 | |
| 5 | #ifndef V8_V8_TEST_H_ |
| 6 | #define V8_V8_TEST_H_ |
| 7 | |
Ben Murdoch | 4a90d5f | 2016-03-22 12:00:34 +0000 | [diff] [blame] | 8 | #include "v8.h" // NOLINT(build/include) |
Ben Murdoch | b0fe162 | 2011-05-05 13:52:32 +0100 | [diff] [blame] | 9 | |
Ben Murdoch | b0fe162 | 2011-05-05 13:52:32 +0100 | [diff] [blame] | 10 | /** |
| 11 | * Testing support for the V8 JavaScript engine. |
| 12 | */ |
| 13 | namespace v8 { |
| 14 | |
Ben Murdoch | b8a8cc1 | 2014-11-26 15:28:44 +0000 | [diff] [blame] | 15 | class V8_EXPORT Testing { |
Ben Murdoch | b0fe162 | 2011-05-05 13:52:32 +0100 | [diff] [blame] | 16 | 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 Block | 44f0eee | 2011-05-26 01:26:41 +0100 | [diff] [blame] | 38 | |
| 39 | /** |
| 40 | * Force deoptimization of all functions. |
| 41 | */ |
Ben Murdoch | 4a90d5f | 2016-03-22 12:00:34 +0000 | [diff] [blame] | 42 | static void DeoptimizeAll(Isolate* isolate); |
Ben Murdoch | b0fe162 | 2011-05-05 13:52:32 +0100 | [diff] [blame] | 43 | }; |
| 44 | |
| 45 | |
| 46 | } // namespace v8 |
| 47 | |
Ben Murdoch | b0fe162 | 2011-05-05 13:52:32 +0100 | [diff] [blame] | 48 | #endif // V8_V8_TEST_H_ |