V8 Project
v8::Testing Class Reference

#include <v8-testing.h>

+ Collaboration diagram for v8::Testing:

Public Types

enum  StressType { kStressTypeOpt , kStressTypeDeopt }
 

Static Public Member Functions

static void SetStressRunType (StressType type)
 Set the type of stressing to do. More...
 
static int GetStressRuns ()
 Get the number of runs of a given test that is required to get the full stress coverage. More...
 
static void PrepareStressRun (int run)
 Indicate the number of the run which is about to start. More...
 
static void DeoptimizeAll ()
 Force deoptimization of all functions. More...
 

Detailed Description

Definition at line 15 of file v8-testing.h.

Member Enumeration Documentation

◆ StressType

Enumerator
kStressTypeOpt 
kStressTypeDeopt 

Definition at line 17 of file v8-testing.h.

17  {
20  };
@ kStressTypeDeopt
Definition: v8-testing.h:19
@ kStressTypeOpt
Definition: v8-testing.h:18

Member Function Documentation

◆ DeoptimizeAll()

void v8::Testing::DeoptimizeAll ( )
static

Force deoptimization of all functions.

Definition at line 7514 of file api.cc.

7514  {
7515  i::Isolate* isolate = i::Isolate::Current();
7516  i::HandleScope scope(isolate);
7518 }
static void DeoptimizeAll(Isolate *isolate)
Definition: deoptimizer.cc:437

References v8::internal::Deoptimizer::DeoptimizeAll().

Referenced by v8::Shell::Main().

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ GetStressRuns()

int v8::Testing::GetStressRuns ( )
static

Get the number of runs of a given test that is required to get the full stress coverage.

Definition at line 7461 of file api.cc.

7461  {
7462  if (internal::FLAG_stress_runs != 0) return internal::FLAG_stress_runs;
7463 #ifdef DEBUG
7464  // In debug mode the code runs much slower so stressing will only make two
7465  // runs.
7466  return 2;
7467 #else
7468  return 5;
7469 #endif
7470 }

Referenced by v8::Shell::Main().

+ Here is the caller graph for this function:

◆ PrepareStressRun()

void v8::Testing::PrepareStressRun ( int  run)
static

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()

Definition at line 7478 of file api.cc.

7478  {
7479  static const char* kLazyOptimizations =
7480  "--prepare-always-opt "
7481  "--max-inlined-source-size=999999 "
7482  "--max-inlined-nodes=999999 "
7483  "--max-inlined-nodes-cumulative=999999 "
7484  "--noalways-opt";
7485  static const char* kForcedOptimizations = "--always-opt";
7486 
7487  // If deoptimization stressed turn on frequent deoptimization. If no value
7488  // is spefified through --deopt-every-n-times use a default default value.
7489  static const char* kDeoptEvery13Times = "--deopt-every-n-times=13";
7491  internal::FLAG_deopt_every_n_times == 0) {
7492  SetFlagsFromString(kDeoptEvery13Times);
7493  }
7494 
7495 #ifdef DEBUG
7496  // As stressing in debug mode only make two runs skip the deopt stressing
7497  // here.
7498  if (run == GetStressRuns() - 1) {
7499  SetFlagsFromString(kForcedOptimizations);
7500  } else {
7501  SetFlagsFromString(kLazyOptimizations);
7502  }
7503 #else
7504  if (run == GetStressRuns() - 1) {
7505  SetFlagsFromString(kForcedOptimizations);
7506  } else if (run != GetStressRuns() - 2) {
7507  SetFlagsFromString(kLazyOptimizations);
7508  }
7509 #endif
7510 }
static int GetStressRuns()
Get the number of runs of a given test that is required to get the full stress coverage.
Definition: api.cc:7461
static v8::Testing::StressType stress_type()
Definition: api.h:687
static void SetFlagsFromString(const char *flags)
Definition: api.cc:7473

References kStressTypeDeopt, v8::SetFlagsFromString(), and v8::internal::Testing::stress_type().

Referenced by v8::Shell::Main().

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ SetStressRunType()

void v8::Testing::SetStressRunType ( Testing::StressType  type)
static

Set the type of stressing to do.

The default if not set is kStressTypeOpt.

Definition at line 7456 of file api.cc.

7456  {
7458 }
static void set_stress_type(v8::Testing::StressType stress_type)
Definition: api.h:688

References v8::internal::Testing::set_stress_type().

Referenced by v8::Shell::Main().

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

The documentation for this class was generated from the following files: