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 77 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
88 const char* unexpected_source, | 88 const char* unexpected_source, |
89 int unexpected, | 89 int unexpected, |
90 const char* value_source, | 90 const char* value_source, |
91 int value) { | 91 int value) { |
92 if (unexpected == value) { | 92 if (unexpected == value) { |
93 V8_Fatal(file, line, "CHECK_NE(%s, %s) failed\n# Value: %i", | 93 V8_Fatal(file, line, "CHECK_NE(%s, %s) failed\n# Value: %i", |
94 unexpected_source, value_source, value); | 94 unexpected_source, value_source, value); |
95 } | 95 } |
96 } | 96 } |
97 | 97 |
98 #ifdef V8_TARGET_ARCH_X64 | |
99 // Helper function used by the CHECK_EQ function when given intptr_t | |
100 // arguments. Should not be called directly. | |
101 static inline void CheckEqualsHelper(const char* file, | |
102 int line, | |
103 const char* expected_source, | |
104 intptr_t expected, | |
105 const char* value_source, | |
106 intptr_t value) { | |
107 if (expected != value) { | |
108 V8_Fatal(file, line, | |
109 "CHECK_EQ(%s, %s) failed\n# Expected: %i\n# Found: %i", | |
110 expected_source, value_source, expected, value); | |
111 } | |
112 } | |
113 | |
114 | |
115 // Helper function used by the CHECK_NE function when given intptr_t | |
116 // arguments. Should not be called directly. | |
117 static inline void CheckNonEqualsHelper(const char* file, | |
118 int line, | |
119 const char* unexpected_source, | |
120 intptr_t unexpected, | |
121 const char* value_source, | |
122 intptr_t value) { | |
123 if (unexpected == value) { | |
124 V8_Fatal(file, line, "CHECK_NE(%s, %s) failed\n# Value: %i", | |
125 unexpected_source, value_source, value); | |
126 } | |
127 } | |
128 #endif // V8_TARGET_ARCH_X64 | |
129 | |
130 | 98 |
131 // Helper function used by the CHECK function when given string | 99 // Helper function used by the CHECK function when given string |
132 // arguments. Should not be called directly. | 100 // arguments. Should not be called directly. |
133 static inline void CheckEqualsHelper(const char* file, | 101 static inline void CheckEqualsHelper(const char* file, |
134 int line, | 102 int line, |
135 const char* expected_source, | 103 const char* expected_source, |
136 const char* expected, | 104 const char* expected, |
137 const char* value_source, | 105 const char* value_source, |
138 const char* value) { | 106 const char* value) { |
139 if (strcmp(expected, value) != 0) { | 107 if (strcmp(expected, value) != 0) { |
(...skipping 146 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
286 | 254 |
287 | 255 |
288 #define ASSERT_TAG_ALIGNED(address) \ | 256 #define ASSERT_TAG_ALIGNED(address) \ |
289 ASSERT((reinterpret_cast<intptr_t>(address) & kHeapObjectTagMask) == 0) | 257 ASSERT((reinterpret_cast<intptr_t>(address) & kHeapObjectTagMask) == 0) |
290 | 258 |
291 #define ASSERT_SIZE_TAG_ALIGNED(size) ASSERT((size & kHeapObjectTagMask) == 0) | 259 #define ASSERT_SIZE_TAG_ALIGNED(size) ASSERT((size & kHeapObjectTagMask) == 0) |
292 | 260 |
293 #define ASSERT_NOT_NULL(p) ASSERT_NE(NULL, p) | 261 #define ASSERT_NOT_NULL(p) ASSERT_NE(NULL, p) |
294 | 262 |
295 #endif // V8_CHECKS_H_ | 263 #endif // V8_CHECKS_H_ |
OLD | NEW |