Reviewers: Lasse Reichstein,

Message:
Fix precedence in expressions using &.  Original patch by
[email protected], [email protected], [email protected].  BUG=383

Description:
Clarify precedence of operations involving bitwise and(&) in
x64/assembler.

Please review this at http://codereview.chromium.org/131099

SVN Base: http://v8.googlecode.com/svn/branches/bleeding_edge/

Affected files:
   M     AUTHORS
   M     src/x64/assembler-x64-inl.h
   M     src/x64/assembler-x64.h
   M     src/x64/assembler-x64.cc


Index: AUTHORS
===================================================================
--- AUTHORS     (revision 2222)
+++ AUTHORS     (working copy)
@@ -6,6 +6,7 @@
  Google Inc.

  Alexander Botero-Lowry <[email protected]>
+Alexandre Vassalotti <[email protected]>
  Craig Schlenter <[email protected]>
  Daniel Andersson <[email protected]>
  Daniel James <[email protected]>
Index: src/x64/assembler-x64.cc
===================================================================
--- src/x64/assembler-x64.cc    (revision 2222)
+++ src/x64/assembler-x64.cc    (working copy)
@@ -1021,7 +1021,7 @@
    last_pc_ = pc_;
    ASSERT(!Heap::InNewSpace(*value));
    emit_rex_64(dst);
-  emit(0xB8 | dst.code() & 0x7);
+  emit(0xB8 | (dst.code() & 0x7));
    if (value->IsHeapObject()) {
      emitq(reinterpret_cast<uintptr_t>(value.location()), mode);
    } else {
Index: src/x64/assembler-x64.h
===================================================================
--- src/x64/assembler-x64.h     (revision 2222)
+++ src/x64/assembler-x64.h     (working copy)
@@ -45,7 +45,7 @@
  // Test whether a 64-bit value is in a specific range.
  static inline bool is_uint32(int64_t x) {
    const int64_t kUInt32Mask = V8_INT64_C(0xffffffff);
-  return x == x & kUInt32Mask;
+  return x == (x & kUInt32Mask);
  }

  static inline bool is_int32(int64_t x) {
Index: src/x64/assembler-x64-inl.h
===================================================================
--- src/x64/assembler-x64-inl.h (revision 2222)
+++ src/x64/assembler-x64-inl.h (working copy)
@@ -123,7 +123,7 @@


  void Assembler::emit_optional_rex_32(Register rm_reg) {
-  if (rm_reg.code() & 0x8 != 0) emit(0x41);
+  if (rm_reg.code() > 0x7) emit(0x41);
  }





--~--~---------~--~----~------------~-------~--~----~
v8-dev mailing list
[email protected]
http://groups.google.com/group/v8-dev
-~----------~----~----~----~------~----~------~--~---

Reply via email to