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

Unified Diff: src/x64/assembler-x64.h

Issue 2818026: X64: A bunch of small fixes. (Closed)
Patch Set: Addressed review comments. As discussed, also fix call/jmp. Created 10 years, 6 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/x64/assembler-x64.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: src/x64/assembler-x64.h
diff --git a/src/x64/assembler-x64.h b/src/x64/assembler-x64.h
index f195439eba9f91866206bff06362edc2e0a28a2c..1bddea4bf65241af0d1d8c847270dac62e66e402 100644
--- a/src/x64/assembler-x64.h
+++ b/src/x64/assembler-x64.h
@@ -46,23 +46,23 @@ namespace internal {
// Test whether a 64-bit value is in a specific range.
static inline bool is_uint32(int64_t x) {
- static const int64_t kUInt32Mask = V8_INT64_C(0xffffffff);
- return x == (x & kUInt32Mask);
+ static const uint64_t kMaxUInt32 = V8_UINT64_C(0xffffffff);
+ return static_cast<uint64_t>(x) <= kMaxUInt32;
}
static inline bool is_int32(int64_t x) {
- static const int64_t kMinIntValue = V8_INT64_C(-0x80000000);
- return is_uint32(x - kMinIntValue);
+ static const int64_t kMinInt32 = -V8_INT64_C(0x80000000);
+ return is_uint32(x - kMinInt32);
}
static inline bool uint_is_int32(uint64_t x) {
- static const uint64_t kMaxIntValue = V8_UINT64_C(0x80000000);
- return x < kMaxIntValue;
+ static const uint64_t kMaxInt32 = V8_UINT64_C(0x7fffffff);
+ return x <= kMaxInt32;
}
static inline bool is_uint32(uint64_t x) {
- static const uint64_t kMaxUIntValue = V8_UINT64_C(0x100000000);
- return x < kMaxUIntValue;
+ static const uint64_t kMaxUInt32 = V8_UINT64_C(0xffffffff);
+ return x <= kMaxUInt32;
}
// CPU Registers.
« no previous file with comments | « no previous file | src/x64/assembler-x64.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698