| OLD | NEW |
| 1 // Copyright 2012 the V8 project authors. All rights reserved. | 1 // Copyright 2012 the V8 project authors. All rights reserved. |
| 2 // Redistribution and use in source and binary forms, with or without | 2 // Redistribution and use in source and binary forms, with or without |
| 3 // modification, are permitted provided that the following conditions are | 3 // modification, are permitted provided that the following conditions are |
| 4 // met: | 4 // met: |
| 5 // | 5 // |
| 6 // * Redistributions of source code must retain the above copyright | 6 // * Redistributions of source code must retain the above copyright |
| 7 // notice, this list of conditions and the following disclaimer. | 7 // notice, this list of conditions and the following disclaimer. |
| 8 // * Redistributions in binary form must reproduce the above | 8 // * Redistributions in binary form must reproduce the above |
| 9 // copyright notice, this list of conditions and the following | 9 // copyright notice, this list of conditions and the following |
| 10 // disclaimer in the documentation and/or other materials provided | 10 // disclaimer in the documentation and/or other materials provided |
| (...skipping 247 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 258 V8_Fatal(file, line, | 258 V8_Fatal(file, line, |
| 259 "CHECK_EQ(%s, %s) failed\n# Expected: %f\n# Found: %f", | 259 "CHECK_EQ(%s, %s) failed\n# Expected: %f\n# Found: %f", |
| 260 expected_source, value_source, *exp, *val); | 260 expected_source, value_source, *exp, *val); |
| 261 } | 261 } |
| 262 delete[] exp; | 262 delete[] exp; |
| 263 delete[] val; | 263 delete[] val; |
| 264 } | 264 } |
| 265 | 265 |
| 266 | 266 |
| 267 inline void CheckNonEqualsHelper(const char* file, | 267 inline void CheckNonEqualsHelper(const char* file, |
| 268 int line, |
| 269 const char* expected_source, |
| 270 int64_t expected, |
| 271 const char* value_source, |
| 272 int64_t value) { |
| 273 if (expected == value) { |
| 274 V8_Fatal(file, line, |
| 275 "CHECK_EQ(%s, %s) failed\n# Expected: %f\n# Found: %f", |
| 276 expected_source, value_source, expected, value); |
| 277 } |
| 278 } |
| 279 |
| 280 |
| 281 inline void CheckNonEqualsHelper(const char* file, |
| 268 int line, | 282 int line, |
| 269 const char* expected_source, | 283 const char* expected_source, |
| 270 double expected, | 284 double expected, |
| 271 const char* value_source, | 285 const char* value_source, |
| 272 double value) { | 286 double value) { |
| 273 // Force values to 64 bit memory to truncate 80 bit precision on IA32. | 287 // Force values to 64 bit memory to truncate 80 bit precision on IA32. |
| 274 volatile double* exp = new double[1]; | 288 volatile double* exp = new double[1]; |
| 275 *exp = expected; | 289 *exp = expected; |
| 276 volatile double* val = new double[1]; | 290 volatile double* val = new double[1]; |
| 277 *val = value; | 291 *val = value; |
| (...skipping 83 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 361 | 375 |
| 362 // "Extra checks" are lightweight checks that are enabled in some release | 376 // "Extra checks" are lightweight checks that are enabled in some release |
| 363 // builds. | 377 // builds. |
| 364 #ifdef ENABLE_EXTRA_CHECKS | 378 #ifdef ENABLE_EXTRA_CHECKS |
| 365 #define EXTRA_CHECK(condition) CHECK(condition) | 379 #define EXTRA_CHECK(condition) CHECK(condition) |
| 366 #else | 380 #else |
| 367 #define EXTRA_CHECK(condition) ((void) 0) | 381 #define EXTRA_CHECK(condition) ((void) 0) |
| 368 #endif | 382 #endif |
| 369 | 383 |
| 370 #endif // V8_CHECKS_H_ | 384 #endif // V8_CHECKS_H_ |
| OLD | NEW |