| OLD | NEW |
| 1 // Copyright 2006-2008 the V8 project authors. All rights reserved. | 1 // Copyright 2006-2008 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 62 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 73 static inline void CheckEqualsHelper(const char* file, int line, | 73 static inline void CheckEqualsHelper(const char* file, int line, |
| 74 const char* expected_source, int expected, | 74 const char* expected_source, int expected, |
| 75 const char* value_source, int value) { | 75 const char* value_source, int value) { |
| 76 if (expected != value) { | 76 if (expected != value) { |
| 77 V8_Fatal(file, line, | 77 V8_Fatal(file, line, |
| 78 "CHECK_EQ(%s, %s) failed\n# Expected: %i\n# Found: %i", | 78 "CHECK_EQ(%s, %s) failed\n# Expected: %i\n# Found: %i", |
| 79 expected_source, value_source, expected, value); | 79 expected_source, value_source, expected, value); |
| 80 } | 80 } |
| 81 } | 81 } |
| 82 | 82 |
| 83 // Helper function used by the CHECK_EQ function when given int64_t |
| 84 // arguments. Should not be called directly. |
| 85 static inline void CheckEqualsHelper(const char* file, int line, |
| 86 const char* expected_source, |
| 87 int64_t expected, |
| 88 const char* value_source, |
| 89 int64_t value) { |
| 90 if (expected != value) { |
| 91 // Print int64_t values in hex, as two int32s, |
| 92 // to avoid platform-dependencies. |
| 93 V8_Fatal(file, line, |
| 94 "CHECK_EQ(%s, %s) failed\n#" |
| 95 " Expected: 0x%08x%08x\n# Found: 0x%08x%08x", |
| 96 expected_source, value_source, |
| 97 static_cast<uint32_t>(expected >> 32), |
| 98 static_cast<uint32_t>(expected), |
| 99 static_cast<uint32_t>(value >> 32), |
| 100 static_cast<uint32_t>(value)); |
| 101 } |
| 102 } |
| 103 |
| 83 | 104 |
| 84 // Helper function used by the CHECK_NE function when given int | 105 // Helper function used by the CHECK_NE function when given int |
| 85 // arguments. Should not be called directly. | 106 // arguments. Should not be called directly. |
| 86 static inline void CheckNonEqualsHelper(const char* file, | 107 static inline void CheckNonEqualsHelper(const char* file, |
| 87 int line, | 108 int line, |
| 88 const char* unexpected_source, | 109 const char* unexpected_source, |
| 89 int unexpected, | 110 int unexpected, |
| 90 const char* value_source, | 111 const char* value_source, |
| 91 int value) { | 112 int value) { |
| 92 if (unexpected == value) { | 113 if (unexpected == value) { |
| (...skipping 161 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 254 | 275 |
| 255 | 276 |
| 256 #define ASSERT_TAG_ALIGNED(address) \ | 277 #define ASSERT_TAG_ALIGNED(address) \ |
| 257 ASSERT((reinterpret_cast<intptr_t>(address) & kHeapObjectTagMask) == 0) | 278 ASSERT((reinterpret_cast<intptr_t>(address) & kHeapObjectTagMask) == 0) |
| 258 | 279 |
| 259 #define ASSERT_SIZE_TAG_ALIGNED(size) ASSERT((size & kHeapObjectTagMask) == 0) | 280 #define ASSERT_SIZE_TAG_ALIGNED(size) ASSERT((size & kHeapObjectTagMask) == 0) |
| 260 | 281 |
| 261 #define ASSERT_NOT_NULL(p) ASSERT_NE(NULL, p) | 282 #define ASSERT_NOT_NULL(p) ASSERT_NE(NULL, p) |
| 262 | 283 |
| 263 #endif // V8_CHECKS_H_ | 284 #endif // V8_CHECKS_H_ |
| OLD | NEW |