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 | |
128 // Helper function used by the CHECK_NE function when given int | 106 // Helper function used by the CHECK_NE function when given int |
129 // arguments. Should not be called directly. | 107 // arguments. Should not be called directly. |
130 static inline void CheckNonEqualsHelper(const char* file, | 108 static inline void CheckNonEqualsHelper(const char* file, |
131 int line, | 109 int line, |
132 const char* unexpected_source, | 110 const char* unexpected_source, |
133 int unexpected, | 111 int unexpected, |
134 const char* value_source, | 112 const char* value_source, |
135 int value) { | 113 int value) { |
136 if (unexpected == value) { | 114 if (unexpected == value) { |
137 V8_Fatal(file, line, "CHECK_NE(%s, %s) failed\n# Value: %i", | 115 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... |
323 | 301 |
324 | 302 |
325 #define ASSERT_TAG_ALIGNED(address) \ | 303 #define ASSERT_TAG_ALIGNED(address) \ |
326 ASSERT((reinterpret_cast<intptr_t>(address) & kHeapObjectTagMask) == 0) | 304 ASSERT((reinterpret_cast<intptr_t>(address) & kHeapObjectTagMask) == 0) |
327 | 305 |
328 #define ASSERT_SIZE_TAG_ALIGNED(size) ASSERT((size & kHeapObjectTagMask) == 0) | 306 #define ASSERT_SIZE_TAG_ALIGNED(size) ASSERT((size & kHeapObjectTagMask) == 0) |
329 | 307 |
330 #define ASSERT_NOT_NULL(p) ASSERT_NE(NULL, p) | 308 #define ASSERT_NOT_NULL(p) ASSERT_NE(NULL, p) |
331 | 309 |
332 #endif // V8_CHECKS_H_ | 310 #endif // V8_CHECKS_H_ |
OLD | NEW |