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

Side by Side Diff: src/utils.h

Issue 115559: X64: Disabled RSet in 64-bit mode. (Closed)
Patch Set: Created 11 years, 7 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
« no previous file with comments | « src/spaces-inl.h ('k') | src/v8threads.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 36 matching lines...) Expand 10 before | Expand all | Expand 10 after
47 // though. 47 // though.
48 static inline int ArithmeticShiftRight(int x, int s) { 48 static inline int ArithmeticShiftRight(int x, int s) {
49 return x >> s; 49 return x >> s;
50 } 50 }
51 51
52 52
53 // Compute the 0-relative offset of some absolute value x of type T. 53 // Compute the 0-relative offset of some absolute value x of type T.
54 // This allows conversion of Addresses and integral types into 54 // This allows conversion of Addresses and integral types into
55 // 0-relative int offsets. 55 // 0-relative int offsets.
56 template <typename T> 56 template <typename T>
57 static inline int OffsetFrom(T x) { 57 static inline intptr_t OffsetFrom(T x) {
58 return x - static_cast<T>(0); 58 return x - static_cast<T>(0);
59 } 59 }
60 60
61 61
62 // Compute the absolute value of type T for some 0-relative offset x. 62 // Compute the absolute value of type T for some 0-relative offset x.
63 // This allows conversion of 0-relative int offsets into Addresses and 63 // This allows conversion of 0-relative int offsets into Addresses and
64 // integral types. 64 // integral types.
65 template <typename T> 65 template <typename T>
66 static inline T AddressFrom(int x) { 66 static inline T AddressFrom(intptr_t x) {
67 return static_cast<T>(0) + x; 67 return static_cast<T>(0) + x;
68 } 68 }
69 69
70 70
71 // Return the largest multiple of m which is <= x. 71 // Return the largest multiple of m which is <= x.
72 template <typename T> 72 template <typename T>
73 static inline T RoundDown(T x, int m) { 73 static inline T RoundDown(T x, int m) {
74 ASSERT(IsPowerOf2(m)); 74 ASSERT(IsPowerOf2(m));
75 return AddressFrom<T>(OffsetFrom(x) & -m); 75 return AddressFrom<T>(OffsetFrom(x) & -m);
76 } 76 }
(...skipping 468 matching lines...) Expand 10 before | Expand all | Expand 10 after
545 #endif 545 #endif
546 while (dest < limit) { 546 while (dest < limit) {
547 *dest++ = static_cast<sinkchar>(*src++); 547 *dest++ = static_cast<sinkchar>(*src++);
548 } 548 }
549 } 549 }
550 550
551 551
552 } } // namespace v8::internal 552 } } // namespace v8::internal
553 553
554 #endif // V8_UTILS_H_ 554 #endif // V8_UTILS_H_
OLDNEW
« no previous file with comments | « src/spaces-inl.h ('k') | src/v8threads.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698