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

Side by Side Diff: src/utils.h

Issue 656143004: Remove (untested) code for unsupported compilers. (Closed) Base URL: https://v8.googlecode.com/svn/branches/bleeding_edge
Patch Set: Fix comment. Created 6 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 | « src/preparser.cc ('k') | test/cctest/cctest.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 2012 the V8 project authors. All rights reserved. 1 // Copyright 2012 the V8 project authors. All rights reserved.
2 // Use of this source code is governed by a BSD-style license that can be 2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file. 3 // found in the LICENSE file.
4 4
5 #ifndef V8_UTILS_H_ 5 #ifndef V8_UTILS_H_
6 #define V8_UTILS_H_ 6 #define V8_UTILS_H_
7 7
8 #include <limits.h> 8 #include <limits.h>
9 #include <stdlib.h> 9 #include <stdlib.h>
10 #include <string.h> 10 #include <string.h>
(...skipping 138 matching lines...) Expand 10 before | Expand all | Expand 10 after
149 149
150 // Returns the absolute value of its argument. 150 // Returns the absolute value of its argument.
151 template <typename T> 151 template <typename T>
152 T Abs(T a) { 152 T Abs(T a) {
153 return a < 0 ? -a : a; 153 return a < 0 ? -a : a;
154 } 154 }
155 155
156 156
157 // Floor(-0.0) == 0.0 157 // Floor(-0.0) == 0.0
158 inline double Floor(double x) { 158 inline double Floor(double x) {
159 #ifdef _MSC_VER 159 #if V8_CC_MSVC
160 if (x == 0) return x; // Fix for issue 3477. 160 if (x == 0) return x; // Fix for issue 3477.
161 #endif 161 #endif
162 return std::floor(x); 162 return std::floor(x);
163 } 163 }
164 164
165 165
166 // TODO(svenpanne) Clean up the whole power-of-2 mess. 166 // TODO(svenpanne) Clean up the whole power-of-2 mess.
167 inline int32_t WhichPowerOf2Abs(int32_t x) { 167 inline int32_t WhichPowerOf2Abs(int32_t x) {
168 return (x == kMinInt) ? 31 : WhichPowerOf2(Abs(x)); 168 return (x == kMinInt) ? 31 : WhichPowerOf2(Abs(x));
169 } 169 }
(...skipping 1314 matching lines...) Expand 10 before | Expand all | Expand 10 after
1484 // Takes the address of the limit variable in order to find out where 1484 // Takes the address of the limit variable in order to find out where
1485 // the top of stack is right now. 1485 // the top of stack is right now.
1486 uintptr_t limit = reinterpret_cast<uintptr_t>(&limit); 1486 uintptr_t limit = reinterpret_cast<uintptr_t>(&limit);
1487 return limit; 1487 return limit;
1488 } 1488 }
1489 1489
1490 } // namespace internal 1490 } // namespace internal
1491 } // namespace v8 1491 } // namespace v8
1492 1492
1493 #endif // V8_UTILS_H_ 1493 #endif // V8_UTILS_H_
OLDNEW
« no previous file with comments | « src/preparser.cc ('k') | test/cctest/cctest.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698