V8 Project
checks.cc File Reference
#include "src/checks.h"
#include "src/v8.h"
+ Include dependency graph for checks.cc:

Go to the source code of this file.

Namespaces

 v8
 Debugger support for the V8 JavaScript engine.
 
 v8::internal
 

Functions

intptr_t v8::internal::HeapObjectTagMask ()
 
static bool CheckEqualsStrict (volatile double *exp, volatile double *val)
 
void CheckEqualsHelper (const char *file, int line, const char *expected_source, double expected, const char *value_source, double value)
 
void CheckNonEqualsHelper (const char *file, int line, const char *expected_source, double expected, const char *value_source, double value)
 
void CheckEqualsHelper (const char *file, int line, const char *expected_source, v8::Handle< v8::Value > expected, const char *value_source, v8::Handle< v8::Value > value)
 
void CheckNonEqualsHelper (const char *file, int line, const char *unexpected_source, v8::Handle< v8::Value > unexpected, const char *value_source, v8::Handle< v8::Value > value)
 

Function Documentation

◆ CheckEqualsHelper() [1/2]

void CheckEqualsHelper ( const char *  file,
int  line,
const char *  expected_source,
double  expected,
const char *  value_source,
double  value 
)

Definition at line 25 of file checks.cc.

27  {
28  // Force values to 64 bit memory to truncate 80 bit precision on IA32.
29  volatile double* exp = new double[1];
30  *exp = expected;
31  volatile double* val = new double[1];
32  *val = value;
33  if (!CheckEqualsStrict(exp, val)) {
34  V8_Fatal(file, line,
35  "CHECK_EQ(%s, %s) failed\n# Expected: %f\n# Found: %f",
36  expected_source, value_source, *exp, *val);
37  }
38  delete[] exp;
39  delete[] val;
40 }
static bool CheckEqualsStrict(volatile double *exp, volatile double *val)
Definition: checks.cc:17
enable harmony numeric enable harmony object literal extensions Optimize object Array DOM strings and string trace pretenuring decisions of HAllocate instructions Enables optimizations which favor memory size over execution speed maximum source size in bytes considered for a single inlining maximum cumulative number of AST nodes considered for inlining trace the tracking of allocation sites deoptimize every n garbage collections perform array bounds checks elimination analyze liveness of environment slots and zap dead values flushes the cache of optimized code for closures on every GC allow uint32 values on optimize frames if they are used only in safe operations track concurrent recompilation artificial compilation delay in ms do not emit check maps for constant values that have a leaf deoptimize the optimized code if the layout of the maps changes enable context specialization in TurboFan execution budget before interrupt is triggered max percentage of megamorphic generic ICs to allow optimization enable use of SAHF instruction if enable use of VFP3 instructions if available enable use of NEON instructions if enable use of SDIV and UDIV instructions if enable use of MLS instructions if enable loading bit constant by means of movw movt instruction enable unaligned accesses for enable use of d16 d31 registers on ARM this requires VFP3 force all emitted branches to be in long enable alignment of csp to bytes on platforms which prefer the register to always be expose gc extension under the specified name show built in functions in stack traces use random jit cookie to mask large constants minimum length for automatic enable preparsing CPU profiler sampling interval in microseconds trace out of bounds accesses to external arrays default size of stack region v8 is allowed to maximum length of function source code printed in a stack trace min size of a semi the new space consists of two semi spaces print one trace line following each garbage collection do not print trace line after scavenger collection print cumulative GC statistics in only print modified registers Trace simulator debug messages Implied by trace sim abort randomize hashes to avoid predictable hash Fixed seed to use to hash property Print the time it takes to deserialize the snapshot A filename with extra code to be included in the A file to write the raw snapshot bytes A file to write the raw context snapshot bytes Write V8 startup blob file(mksnapshot only)") DEFINE_BOOL(profile_hydrogen_code_stub_compilation
void V8_Fatal(const char *file, int line, const char *format,...)
Definition: logging.cc:75

References CheckEqualsStrict(), file(), and V8_Fatal().

+ Here is the call graph for this function:

◆ CheckEqualsHelper() [2/2]

void CheckEqualsHelper ( const char *  file,
int  line,
const char *  expected_source,
v8::Handle< v8::Value expected,
const char *  value_source,
v8::Handle< v8::Value value 
)

Definition at line 61 of file checks.cc.

66  {
67  if (!expected->Equals(value)) {
68  v8::String::Utf8Value value_str(value);
69  v8::String::Utf8Value expected_str(expected);
70  V8_Fatal(file, line,
71  "CHECK_EQ(%s, %s) failed\n# Expected: %s\n# Found: %s",
72  expected_source, value_source, *expected_str, *value_str);
73  }
74 }
Converts an object to a UTF-8-encoded character array.
Definition: v8.h:2048
bool Equals(Handle< Value > that) const
JS ==.
Definition: api.cc:3025

References v8::Value::Equals(), file(), and V8_Fatal().

+ Here is the call graph for this function:

◆ CheckEqualsStrict()

static bool CheckEqualsStrict ( volatile double *  exp,
volatile double *  val 
)
static

Definition at line 17 of file checks.cc.

17  {
20  if (std::isnan(exp_rep.value) && std::isnan(val_rep.value)) return true;
21  return exp_rep.bits == val_rep.bits;
22 }

References v8::internal::DoubleRepresentation::bits, and v8::internal::DoubleRepresentation::value.

Referenced by CheckEqualsHelper(), and CheckNonEqualsHelper().

+ Here is the caller graph for this function:

◆ CheckNonEqualsHelper() [1/2]

void CheckNonEqualsHelper ( const char *  file,
int  line,
const char *  expected_source,
double  expected,
const char *  value_source,
double  value 
)

Definition at line 43 of file checks.cc.

45  {
46  // Force values to 64 bit memory to truncate 80 bit precision on IA32.
47  volatile double* exp = new double[1];
48  *exp = expected;
49  volatile double* val = new double[1];
50  *val = value;
51  if (CheckEqualsStrict(exp, val)) {
52  V8_Fatal(file, line,
53  "CHECK_EQ(%s, %s) failed\n# Expected: %f\n# Found: %f",
54  expected_source, value_source, *exp, *val);
55  }
56  delete[] exp;
57  delete[] val;
58 }

References CheckEqualsStrict(), file(), and V8_Fatal().

+ Here is the call graph for this function:

◆ CheckNonEqualsHelper() [2/2]

void CheckNonEqualsHelper ( const char *  file,
int  line,
const char *  unexpected_source,
v8::Handle< v8::Value unexpected,
const char *  value_source,
v8::Handle< v8::Value value 
)

Definition at line 77 of file checks.cc.

82  {
83  if (unexpected->Equals(value)) {
84  v8::String::Utf8Value value_str(value);
85  V8_Fatal(file, line, "CHECK_NE(%s, %s) failed\n# Value: %s",
86  unexpected_source, value_source, *value_str);
87  }
88 }

References v8::Value::Equals(), file(), and V8_Fatal().

+ Here is the call graph for this function: