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

Unified Diff: src/api.cc

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: 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
« include/v8.h ('K') | « include/v8.h ('k') | test/cctest/test-api.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: src/api.cc
diff --git a/src/api.cc b/src/api.cc
index 073306f071a2a260029750d82317014e0067f84f..dbd93b8d5c2c7380b1aefb2cc4560b1bfedce8ab 100644
--- a/src/api.cc
+++ b/src/api.cc
@@ -3267,14 +3267,14 @@ void v8::Object::SetInternalField(int index, v8::Handle<Value> value) {
static bool CanBeEncodedAsSmi(void* ptr) {
- const intptr_t address = reinterpret_cast<intptr_t>(ptr);
+ const uintptr_t address = reinterpret_cast<intptr_t>(ptr);
Vyacheslav Egorov (Chromium) 2011/01/19 10:19:43 <intptr_t> => <uintptr_t>
antonm 2011/01/19 11:16:00 Done.
return ((address & i::kEncodablePointerMask) == 0);
}
static i::Smi* EncodeAsSmi(void* ptr) {
ASSERT(CanBeEncodedAsSmi(ptr));
- const intptr_t address = reinterpret_cast<intptr_t>(ptr);
+ const uintptr_t address = reinterpret_cast<intptr_t>(ptr);
Vyacheslav Egorov (Chromium) 2011/01/19 10:19:43 <intptr_t> => <uintptr_t>
antonm 2011/01/19 11:16:00 Done.
i::Smi* result = reinterpret_cast<i::Smi*>(address << i::kPointerToSmiShift);
ASSERT(i::Internals::HasSmiTag(result));
ASSERT_EQ(result, i::Smi::FromInt(result->value()));
« include/v8.h ('K') | « include/v8.h ('k') | test/cctest/test-api.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698