| 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 118 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 129 // Helper function used by the CHECK function when given pointer | 129 // Helper function used by the CHECK function when given pointer |
| 130 // arguments. Should not be called directly. | 130 // arguments. Should not be called directly. |
| 131 static inline void CheckEqualsHelper(const char* file, | 131 static inline void CheckEqualsHelper(const char* file, |
| 132 int line, | 132 int line, |
| 133 const char* expected_source, | 133 const char* expected_source, |
| 134 void* expected, | 134 void* expected, |
| 135 const char* value_source, | 135 const char* value_source, |
| 136 void* value) { | 136 void* value) { |
| 137 if (expected != value) { | 137 if (expected != value) { |
| 138 V8_Fatal(file, line, | 138 V8_Fatal(file, line, |
| 139 "CHECK_EQ(%s, %s) failed\n# Expected: %i\n# Found: %i", | 139 "CHECK_EQ(%s, %s) failed\n# Expected: %p\n# Found: %p", |
| 140 expected_source, value_source, | 140 expected_source, value_source, |
| 141 reinterpret_cast<int>(expected), reinterpret_cast<int>(value)); | 141 expected, value); |
| 142 } | 142 } |
| 143 } | 143 } |
| 144 | 144 |
| 145 | 145 |
| 146 static inline void CheckNonEqualsHelper(const char* file, | 146 static inline void CheckNonEqualsHelper(const char* file, |
| 147 int line, | 147 int line, |
| 148 const char* expected_source, | 148 const char* expected_source, |
| 149 void* expected, | 149 void* expected, |
| 150 const char* value_source, | 150 const char* value_source, |
| 151 void* value) { | 151 void* value) { |
| 152 if (expected == value) { | 152 if (expected == value) { |
| 153 V8_Fatal(file, line, "CHECK_NE(%s, %s) failed\n# Value: %i", | 153 V8_Fatal(file, line, "CHECK_NE(%s, %s) failed\n# Value: %p", |
| 154 expected_source, value_source, reinterpret_cast<int>(value)); | 154 expected_source, value_source, value); |
| 155 } | 155 } |
| 156 } | 156 } |
| 157 | 157 |
| 158 | 158 |
| 159 // Helper function used by the CHECK function when given floating | 159 // Helper function used by the CHECK function when given floating |
| 160 // point arguments. Should not be called directly. | 160 // point arguments. Should not be called directly. |
| 161 static inline void CheckEqualsHelper(const char* file, | 161 static inline void CheckEqualsHelper(const char* file, |
| 162 int line, | 162 int line, |
| 163 const char* expected_source, | 163 const char* expected_source, |
| 164 double expected, | 164 double expected, |
| (...skipping 89 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 254 | 254 |
| 255 | 255 |
| 256 #define ASSERT_TAG_ALIGNED(address) \ | 256 #define ASSERT_TAG_ALIGNED(address) \ |
| 257 ASSERT((reinterpret_cast<int>(address) & kHeapObjectTagMask) == 0) | 257 ASSERT((reinterpret_cast<int>(address) & kHeapObjectTagMask) == 0) |
| 258 | 258 |
| 259 #define ASSERT_SIZE_TAG_ALIGNED(size) ASSERT((size & kHeapObjectTagMask) == 0) | 259 #define ASSERT_SIZE_TAG_ALIGNED(size) ASSERT((size & kHeapObjectTagMask) == 0) |
| 260 | 260 |
| 261 #define ASSERT_NOT_NULL(p) ASSERT_NE(NULL, p) | 261 #define ASSERT_NOT_NULL(p) ASSERT_NE(NULL, p) |
| 262 | 262 |
| 263 #endif // V8_CHECKS_H_ | 263 #endif // V8_CHECKS_H_ |
| OLD | NEW |