Revision: 17351
Author:   [email protected]
Date:     Thu Oct 24 01:27:47 2013 UTC
Log:      Use the correct version of movq for ExternalReference in X64

[email protected]

Review URL: https://codereview.chromium.org/26410004
http://code.google.com/p/v8/source/detail?r=17351

Modified:
 /branches/bleeding_edge/src/x64/assembler-x64-inl.h
 /branches/bleeding_edge/src/x64/assembler-x64.cc
 /branches/bleeding_edge/src/x64/assembler-x64.h
 /branches/bleeding_edge/src/x64/macro-assembler-x64.cc

=======================================
--- /branches/bleeding_edge/src/x64/assembler-x64-inl.h Wed Oct 23 13:48:04 2013 UTC +++ /branches/bleeding_edge/src/x64/assembler-x64-inl.h Thu Oct 24 01:27:47 2013 UTC
@@ -62,11 +62,8 @@
 }


-void Assembler::emitq(uint64_t x, RelocInfo::Mode rmode) {
+void Assembler::emitq(uint64_t x) {
   Memory::uint64_at(pc_) = x;
-  if (!RelocInfo::IsNone(rmode)) {
-    RecordRelocInfo(rmode, x);
-  }
   pc_ += sizeof(uint64_t);
 }

=======================================
--- /branches/bleeding_edge/src/x64/assembler-x64.cc Wed Oct 23 13:48:04 2013 UTC +++ /branches/bleeding_edge/src/x64/assembler-x64.cc Thu Oct 24 01:27:47 2013 UTC
@@ -1465,26 +1465,24 @@

 void Assembler::movq(Register dst, int64_t value, RelocInfo::Mode rmode) {
   // Non-relocatable values might not need a 64-bit representation.
-  if (RelocInfo::IsNone(rmode)) {
-    if (is_uint32(value)) {
-      movl(dst, Immediate(static_cast<int32_t>(value)));
-      return;
-    } else if (is_int32(value)) {
-      movq(dst, Immediate(static_cast<int32_t>(value)));
-      return;
-    }
+  ASSERT(RelocInfo::IsNone(rmode));
+  if (is_uint32(value)) {
+    movl(dst, Immediate(static_cast<int32_t>(value)));
+  } else if (is_int32(value)) {
+    movq(dst, Immediate(static_cast<int32_t>(value)));
+  } else {
// Value cannot be represented by 32 bits, so do a full 64 bit immediate
     // value.
+    EnsureSpace ensure_space(this);
+    emit_rex_64(dst);
+    emit(0xB8 | dst.low_bits());
+    emitq(value);
   }
-  EnsureSpace ensure_space(this);
-  emit_rex_64(dst);
-  emit(0xB8 | dst.low_bits());
-  emitq(value, rmode);
 }


 void Assembler::movq(Register dst, ExternalReference ref) {
-  int64_t value = reinterpret_cast<int64_t>(ref.address());
+  Address value = reinterpret_cast<Address>(ref.address());
   movq(dst, value, RelocInfo::EXTERNAL_REFERENCE);
 }

=======================================
--- /branches/bleeding_edge/src/x64/assembler-x64.h Thu Oct 10 08:45:40 2013 UTC +++ /branches/bleeding_edge/src/x64/assembler-x64.h Thu Oct 24 01:27:47 2013 UTC
@@ -723,7 +723,6 @@
   // All 64-bit immediates must have a relocation mode.
   void movq(Register dst, void* ptr, RelocInfo::Mode rmode);
   void movq(Register dst, int64_t value, RelocInfo::Mode rmode);
-  void movq(Register dst, const char* s, RelocInfo::Mode rmode);
   // Moves the address of the external reference into the register.
   void movq(Register dst, ExternalReference ext);
   void movq(Register dst, Handle<Object> handle, RelocInfo::Mode rmode);
@@ -1474,7 +1473,7 @@
   void emit(byte x) { *pc_++ = x; }
   inline void emitl(uint32_t x);
   inline void emitp(void* x, RelocInfo::Mode rmode);
-  inline void emitq(uint64_t x, RelocInfo::Mode rmode);
+  inline void emitq(uint64_t x);
   inline void emitw(uint16_t x);
   inline void emit_code_target(Handle<Code> target,
                                RelocInfo::Mode rmode,
=======================================
--- /branches/bleeding_edge/src/x64/macro-assembler-x64.cc Wed Oct 23 13:48:04 2013 UTC +++ /branches/bleeding_edge/src/x64/macro-assembler-x64.cc Thu Oct 24 01:27:47 2013 UTC
@@ -740,7 +740,7 @@

   bind(&profiler_disabled);
   // Call the api function!
-  movq(rax, reinterpret_cast<int64_t>(function_address),
+  movq(rax, reinterpret_cast<Address>(function_address),
        RelocInfo::EXTERNAL_REFERENCE);

   bind(&end_profiler_check);

--
--
v8-dev mailing list
[email protected]
http://groups.google.com/group/v8-dev
--- You received this message because you are subscribed to the Google Groups "v8-dev" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to [email protected].
For more options, visit https://groups.google.com/groups/opt_out.

Reply via email to