Reviewers: Vyacheslav Egorov,

Message:
Slava, would you please take a look at this?

Description:
Fix for an ARM register allocation bug.

An off-by-one in the register allocator could lead to allocating (and
clobbering) the reserved 0.0 double register.  This required a function with
14 or more live double values.

BUG=
TEST=


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

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

Affected files:
  M src/arm/assembler-arm.h


Index: src/arm/assembler-arm.h
diff --git a/src/arm/assembler-arm.h b/src/arm/assembler-arm.h
index 247479d730b834aaae5612374ea680274c759e44..cc74d17034506803c0cca19bd53e29b73e493b3e 100644
--- a/src/arm/assembler-arm.h
+++ b/src/arm/assembler-arm.h
@@ -32,7 +32,7 @@

 // The original source code covered by the above license above has been
 // modified significantly by Google Inc.
-// Copyright 2011 the V8 project authors. All rights reserved.
+// Copyright 2012 the V8 project authors. All rights reserved.

 // A light-weight ARM Assembler
// Generates user mode instructions for the ARM architecture up to version 5
@@ -177,13 +177,13 @@ struct DwVfpRegister {
       kNumReservedRegisters;

   static int ToAllocationIndex(DwVfpRegister reg) {
-    ASSERT(reg.code() != 0);
-    return reg.code() - 1;
+    ASSERT(reg.code() != 14 && reg.code() != 15);
+    return reg.code();
   }

   static DwVfpRegister FromAllocationIndex(int index) {
     ASSERT(index >= 0 && index < kNumAllocatableRegisters);
-    return from_code(index + 1);
+    return from_code(index);
   }

   static const char* AllocationIndexToString(int index) {


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

Reply via email to