Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(685)

Side by Side Diff: src/checks.h

Issue 260002: Add a method to convert unsigned C integer into V8 Integer. (Closed) Base URL: http://v8.googlecode.com/svn/branches/bleeding_edge/
Patch Set: '' Created 11 years, 2 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch | Annotate | Revision Log
« no previous file with comments | « include/v8.h ('k') | test/cctest/test-api.cc » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
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
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 // Sorry, printing int64_t in a fanky hex way,
92 // that's our mother tongue after all :)
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 uint32_t(expected >> 32), uint32_t(expected),
98 uint32_t(value >> 32), uint32_t(value));
99 }
100 }
101
83 102
84 // Helper function used by the CHECK_NE function when given int 103 // Helper function used by the CHECK_NE function when given int
85 // arguments. Should not be called directly. 104 // arguments. Should not be called directly.
86 static inline void CheckNonEqualsHelper(const char* file, 105 static inline void CheckNonEqualsHelper(const char* file,
87 int line, 106 int line,
88 const char* unexpected_source, 107 const char* unexpected_source,
89 int unexpected, 108 int unexpected,
90 const char* value_source, 109 const char* value_source,
91 int value) { 110 int value) {
92 if (unexpected == value) { 111 if (unexpected == value) {
(...skipping 161 matching lines...) Expand 10 before | Expand all | Expand 10 after
254 273
255 274
256 #define ASSERT_TAG_ALIGNED(address) \ 275 #define ASSERT_TAG_ALIGNED(address) \
257 ASSERT((reinterpret_cast<intptr_t>(address) & kHeapObjectTagMask) == 0) 276 ASSERT((reinterpret_cast<intptr_t>(address) & kHeapObjectTagMask) == 0)
258 277
259 #define ASSERT_SIZE_TAG_ALIGNED(size) ASSERT((size & kHeapObjectTagMask) == 0) 278 #define ASSERT_SIZE_TAG_ALIGNED(size) ASSERT((size & kHeapObjectTagMask) == 0)
260 279
261 #define ASSERT_NOT_NULL(p) ASSERT_NE(NULL, p) 280 #define ASSERT_NOT_NULL(p) ASSERT_NE(NULL, p)
262 281
263 #endif // V8_CHECKS_H_ 282 #endif // V8_CHECKS_H_
OLDNEW
« no previous file with comments | « include/v8.h ('k') | test/cctest/test-api.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698