Revision: 16418
Author:   [email protected]
Date:     Thu Aug 29 11:41:14 2013 UTC
Log:      Consolidate SMI functions into one area for X64

[email protected]

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

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

=======================================
--- /branches/bleeding_edge/src/x64/macro-assembler-x64.cc Wed Aug 28 01:07:31 2013 UTC +++ /branches/bleeding_edge/src/x64/macro-assembler-x64.cc Thu Aug 29 11:41:14 2013 UTC
@@ -958,7 +958,10 @@
 }


-bool MacroAssembler::IsUnsafeInt(const int x) {
+// ----------------------------------------------------------------------------
+// Smi tagging, untagging and tag detection.
+
+bool MacroAssembler::IsUnsafeInt(const int32_t x) {
   static const int kMaxBits = 17;
   return !is_intn(x, kMaxBits);
 }
@@ -989,9 +992,6 @@
 }


-// ----------------------------------------------------------------------------
-// Smi tagging, untagging and tag detection.
-
 Register MacroAssembler::GetSmiConstant(Smi* source) {
   int value = source->value();
   if (value == 0) {
@@ -2194,6 +2194,17 @@
   ASSERT_EQ(0, kSmiShift % kBitsPerByte);
   addl(dst, Operand(src, kSmiShift / kBitsPerByte));
 }
+
+
+void MacroAssembler::Push(Smi* source) {
+  intptr_t smi = reinterpret_cast<intptr_t>(source);
+  if (is_int32(smi)) {
+    push(Immediate(static_cast<int32_t>(smi)));
+  } else {
+    Register constant = GetSmiConstant(source);
+    push(constant);
+  }
+}


 void MacroAssembler::PushInt64AsTwoSmis(Register src, Register scratch) {
@@ -2220,6 +2231,14 @@
 }


+void MacroAssembler::Test(const Operand& src, Smi* source) {
+  testl(Operand(src, kIntSize), Immediate(source->value()));
+}
+
+
+// ----------------------------------------------------------------------------
+
+
 void MacroAssembler::JumpIfNotString(Register object,
                                      Register object_map,
                                      Label* not_string,
@@ -2457,17 +2476,6 @@
     movq(dst, Operand(dst, 0));
   }
 }
-
-
-void MacroAssembler::Push(Smi* source) {
-  intptr_t smi = reinterpret_cast<intptr_t>(source);
-  if (is_int32(smi)) {
-    push(Immediate(static_cast<int32_t>(smi)));
-  } else {
-    Register constant = GetSmiConstant(source);
-    push(constant);
-  }
-}


 void MacroAssembler::Drop(int stack_elements) {
@@ -2475,11 +2483,6 @@
     addq(rsp, Immediate(stack_elements * kPointerSize));
   }
 }
-
-
-void MacroAssembler::Test(const Operand& src, Smi* source) {
-  testl(Operand(src, kIntSize), Immediate(source->value()));
-}


 void MacroAssembler::TestBit(const Operand& src, int bits) {
=======================================
--- /branches/bleeding_edge/src/x64/macro-assembler-x64.h Wed Aug 28 01:07:31 2013 UTC +++ /branches/bleeding_edge/src/x64/macro-assembler-x64.h Thu Aug 29 11:41:14 2013 UTC
@@ -375,6 +375,11 @@
// ---------------------------------------------------------------------------
   // Smi tagging, untagging and operations on tagged smis.

+  // Support for constant splitting.
+  bool IsUnsafeInt(const int32_t x);
+  void SafeMove(Register dst, Smi* src);
+  void SafePush(Smi* src);
+
   void InitializeSmiConstantRegister() {
     movq(kSmiConstantRegister,
reinterpret_cast<uint64_t>(Smi::FromInt(kSmiConstantRegisterValue)),
@@ -782,11 +787,6 @@
   // Move if the registers are not identical.
   void Move(Register target, Register source);

-  // Support for constant splitting.
-  bool IsUnsafeInt(const int x);
-  void SafeMove(Register dst, Smi* src);
-  void SafePush(Smi* src);
-
   // Bit-field support.
   void TestBit(const Operand& dst, int bit_index);

--
--
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