Reviewers: Rico,

Description:
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.

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

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

Affected files:
  M     src/v8globals.h
  M     src/version.cc
  M     src/x64/codegen-x64.cc


Index: src/v8globals.h
===================================================================
--- src/v8globals.h     (revision 7609)
+++ src/v8globals.h     (working copy)
@@ -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
Index: src/version.cc
===================================================================
--- src/version.cc      (revision 7609)
+++ src/version.cc      (working copy)
@@ -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
Index: src/x64/codegen-x64.cc
===================================================================
--- src/x64/codegen-x64.cc      (revision 7609)
+++ src/x64/codegen-x64.cc      (working copy)
@@ -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