| 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 85 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 96 " Expected: 0x%08x%08x\n# Found: 0x%08x%08x", | 96 " Expected: 0x%08x%08x\n# Found: 0x%08x%08x", |
| 97 expected_source, value_source, | 97 expected_source, value_source, |
| 98 static_cast<uint32_t>(expected >> 32), | 98 static_cast<uint32_t>(expected >> 32), |
| 99 static_cast<uint32_t>(expected), | 99 static_cast<uint32_t>(expected), |
| 100 static_cast<uint32_t>(value >> 32), | 100 static_cast<uint32_t>(value >> 32), |
| 101 static_cast<uint32_t>(value)); | 101 static_cast<uint32_t>(value)); |
| 102 } | 102 } |
| 103 } | 103 } |
| 104 | 104 |
| 105 | 105 |
| 106 // Helper function used by the CHECK_EQ function when given uint64_t |
| 107 // arguments. Should not be called directly. |
| 108 static inline void CheckEqualsHelper(const char* file, int line, |
| 109 const char* expected_source, |
| 110 uint64_t expected, |
| 111 const char* value_source, |
| 112 uint64_t value) { |
| 113 if (expected != value) { |
| 114 // Print uint64_t values in hex, as two int32s, |
| 115 // to avoid platform-dependencies. |
| 116 V8_Fatal(file, line, |
| 117 "CHECK_EQ(%s, %s) failed\n#" |
| 118 " Expected: 0x%08x%08x\n# Found: 0x%08x%08x", |
| 119 expected_source, value_source, |
| 120 static_cast<uint32_t>(expected >> 32), |
| 121 static_cast<uint32_t>(expected), |
| 122 static_cast<uint32_t>(value >> 32), |
| 123 static_cast<uint32_t>(value)); |
| 124 } |
| 125 } |
| 126 |
| 127 |
| 106 // Helper function used by the CHECK_NE function when given int | 128 // Helper function used by the CHECK_NE function when given int |
| 107 // arguments. Should not be called directly. | 129 // arguments. Should not be called directly. |
| 108 static inline void CheckNonEqualsHelper(const char* file, | 130 static inline void CheckNonEqualsHelper(const char* file, |
| 109 int line, | 131 int line, |
| 110 const char* unexpected_source, | 132 const char* unexpected_source, |
| 111 int unexpected, | 133 int unexpected, |
| 112 const char* value_source, | 134 const char* value_source, |
| 113 int value) { | 135 int value) { |
| 114 if (unexpected == value) { | 136 if (unexpected == value) { |
| 115 V8_Fatal(file, line, "CHECK_NE(%s, %s) failed\n# Value: %i", | 137 V8_Fatal(file, line, "CHECK_NE(%s, %s) failed\n# Value: %i", |
| (...skipping 185 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 301 | 323 |
| 302 | 324 |
| 303 #define ASSERT_TAG_ALIGNED(address) \ | 325 #define ASSERT_TAG_ALIGNED(address) \ |
| 304 ASSERT((reinterpret_cast<intptr_t>(address) & kHeapObjectTagMask) == 0) | 326 ASSERT((reinterpret_cast<intptr_t>(address) & kHeapObjectTagMask) == 0) |
| 305 | 327 |
| 306 #define ASSERT_SIZE_TAG_ALIGNED(size) ASSERT((size & kHeapObjectTagMask) == 0) | 328 #define ASSERT_SIZE_TAG_ALIGNED(size) ASSERT((size & kHeapObjectTagMask) == 0) |
| 307 | 329 |
| 308 #define ASSERT_NOT_NULL(p) ASSERT_NE(NULL, p) | 330 #define ASSERT_NOT_NULL(p) ASSERT_NE(NULL, p) |
| 309 | 331 |
| 310 #endif // V8_CHECKS_H_ | 332 #endif // V8_CHECKS_H_ |
| OLD | NEW |