Revision: 7610
Author:   [email protected]
Date:     Thu Apr 14 00:32:07 2011
Log:      Revert GCC compilation fix on 3.1 branch that contained an invalid
change to the x64 classic codegen. On the 3.1 branch, register r12 is
not reserved.
Review URL: http://codereview.chromium.org/6853008
http://code.google.com/p/v8/source/detail?r=7610

Modified:
 /branches/3.1/src/v8globals.h
 /branches/3.1/src/version.cc
 /branches/3.1/src/x64/codegen-x64.cc

=======================================
--- /branches/3.1/src/v8globals.h       Tue Apr 12 03:46:14 2011
+++ /branches/3.1/src/v8globals.h       Thu Apr 14 00:32:07 2011
@@ -472,11 +472,7 @@
 // The Strict Mode (ECMA-262 5th edition, 4.2.2).
 enum StrictModeFlag {
   kNonStrictMode,
-  kStrictMode,
- // This value is never used, but is needed to prevent GCC 4.5 from failing
-  // to compile when we assert that a flag is either kNonStrictMode or
-  // kStrictMode.
-  kInvalidStrictFlag
+  kStrictMode
 };

 } }  // namespace v8::internal
=======================================
--- /branches/3.1/src/version.cc        Tue Apr 12 03:46:14 2011
+++ /branches/3.1/src/version.cc        Thu Apr 14 00:32:07 2011
@@ -35,7 +35,7 @@
 #define MAJOR_VERSION     3
 #define MINOR_VERSION     1
 #define BUILD_NUMBER      8
-#define PATCH_LEVEL       11
+#define PATCH_LEVEL       12
 #define CANDIDATE_VERSION false

 // Define SONAME to have the SCons build the put a specific SONAME into the
=======================================
--- /branches/3.1/src/x64/codegen-x64.cc        Tue Apr 12 03:46:14 2011
+++ /branches/3.1/src/x64/codegen-x64.cc        Thu Apr 14 00:32:07 2011
@@ -8195,9 +8195,17 @@
     result = allocator()->Allocate();
     ASSERT(result.is_valid());

-    // r12 is now a reserved register, so it cannot be the receiver.
-    // If it was, the distance to the fixup location would not be constant.
-    ASSERT(!receiver.reg().is(r12));
+    // Cannot use r12 for receiver, because that changes
+    // the distance between a call and a fixup location,
+    // due to a special encoding of r12 as r/m in a ModR/M byte.
+    if (receiver.reg().is(r12)) {
+ frame()->Spill(receiver.reg()); // It will be overwritten with result.
+      // Swap receiver and value.
+      __ movq(result.reg(), receiver.reg());
+      Result temp = receiver;
+      receiver = result;
+      result = temp;
+    }

     DeferredReferenceGetNamedValue* deferred =
new DeferredReferenceGetNamedValue(result.reg(), receiver.reg(), name);

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

Reply via email to