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

Unified Diff: include/v8.h

Issue 6242005: Using unsigned shifts and masks when dealing with 64-bit addresses. (Closed) Base URL: https://v8.googlecode.com/svn/branches/bleeding_edge
Patch Set: Addressing Slava's comments Created 9 years, 11 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 side-by-side diff with in-line comments
Download patch
« no previous file with comments | « no previous file | src/api.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: include/v8.h
diff --git a/include/v8.h b/include/v8.h
index 7d18107d92d228c8f6de6e6d519d524e0f5de8ce..5e57bedb9ae8310a91839dc88116ffabdd528261 100644
--- a/include/v8.h
+++ b/include/v8.h
@@ -3367,7 +3367,7 @@ template <> struct SmiTagging<4> {
// For 32-bit systems any 2 bytes aligned pointer can be encoded as smi
// with a plain reinterpret_cast.
- static const intptr_t kEncodablePointerMask = 0x1;
+ static const uintptr_t kEncodablePointerMask = 0x1;
static const int kPointerToSmiShift = 0;
};
@@ -3387,8 +3387,8 @@ template <> struct SmiTagging<8> {
// It might be not enough to cover stack allocated objects on some platforms.
static const int kPointerAlignment = 3;
- static const intptr_t kEncodablePointerMask =
- ~(intptr_t(0xffffffff) << kPointerAlignment);
+ static const uintptr_t kEncodablePointerMask =
+ ~(uintptr_t(0xffffffff) << kPointerAlignment);
static const int kPointerToSmiShift =
kSmiTagSize + kSmiShiftSize - kPointerAlignment;
@@ -3397,7 +3397,7 @@ template <> struct SmiTagging<8> {
typedef SmiTagging<kApiPointerSize> PlatformSmiTagging;
const int kSmiShiftSize = PlatformSmiTagging::kSmiShiftSize;
const int kSmiValueSize = PlatformSmiTagging::kSmiValueSize;
-const intptr_t kEncodablePointerMask =
+const uintptr_t kEncodablePointerMask =
PlatformSmiTagging::kEncodablePointerMask;
const int kPointerToSmiShift = PlatformSmiTagging::kPointerToSmiShift;
@@ -3457,7 +3457,7 @@ class Internals {
}
static inline void* GetExternalPointerFromSmi(internal::Object* value) {
- const intptr_t address = reinterpret_cast<intptr_t>(value);
+ const uintptr_t address = reinterpret_cast<uintptr_t>(value);
return reinterpret_cast<void*>(address >> kPointerToSmiShift);
}
« no previous file with comments | « no previous file | src/api.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698