Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(410)

Side by Side Diff: src/arm/assembler-arm.h

Issue 9114038: Fix for an ARM register allocation bug. (Closed) Base URL: https://v8.googlecode.com/svn/branches/bleeding_edge
Patch Set: Created 8 years, 11 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch | Annotate | Revision Log
« no previous file with comments | « no previous file | no next file » | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 // Copyright (c) 1994-2006 Sun Microsystems Inc. 1 // Copyright (c) 1994-2006 Sun Microsystems Inc.
2 // All Rights Reserved. 2 // All Rights Reserved.
3 // 3 //
4 // Redistribution and use in source and binary forms, with or without 4 // Redistribution and use in source and binary forms, with or without
5 // modification, are permitted provided that the following conditions 5 // modification, are permitted provided that the following conditions
6 // are met: 6 // are met:
7 // 7 //
8 // - Redistributions of source code must retain the above copyright notice, 8 // - Redistributions of source code must retain the above copyright notice,
9 // this list of conditions and the following disclaimer. 9 // this list of conditions and the following disclaimer.
10 // 10 //
(...skipping 14 matching lines...) Expand all
25 // INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES 25 // INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
26 // (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR 26 // (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR
27 // SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) 27 // SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
28 // HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, 28 // HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT,
29 // STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) 29 // STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
30 // ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED 30 // ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED
31 // OF THE POSSIBILITY OF SUCH DAMAGE. 31 // OF THE POSSIBILITY OF SUCH DAMAGE.
32 32
33 // The original source code covered by the above license above has been 33 // The original source code covered by the above license above has been
34 // modified significantly by Google Inc. 34 // modified significantly by Google Inc.
35 // Copyright 2011 the V8 project authors. All rights reserved. 35 // Copyright 2012 the V8 project authors. All rights reserved.
36 36
37 // A light-weight ARM Assembler 37 // A light-weight ARM Assembler
38 // Generates user mode instructions for the ARM architecture up to version 5 38 // Generates user mode instructions for the ARM architecture up to version 5
39 39
40 #ifndef V8_ARM_ASSEMBLER_ARM_H_ 40 #ifndef V8_ARM_ASSEMBLER_ARM_H_
41 #define V8_ARM_ASSEMBLER_ARM_H_ 41 #define V8_ARM_ASSEMBLER_ARM_H_
42 #include <stdio.h> 42 #include <stdio.h>
43 #include "assembler.h" 43 #include "assembler.h"
44 #include "constants-arm.h" 44 #include "constants-arm.h"
45 #include "serialize.h" 45 #include "serialize.h"
(...skipping 124 matching lines...) Expand 10 before | Expand all | Expand 10 after
170 static const int kNumRegisters = 16; 170 static const int kNumRegisters = 16;
171 // A few double registers are reserved: one as a scratch register and one to 171 // A few double registers are reserved: one as a scratch register and one to
172 // hold 0.0, that does not fit in the immediate field of vmov instructions. 172 // hold 0.0, that does not fit in the immediate field of vmov instructions.
173 // d14: 0.0 173 // d14: 0.0
174 // d15: scratch register. 174 // d15: scratch register.
175 static const int kNumReservedRegisters = 2; 175 static const int kNumReservedRegisters = 2;
176 static const int kNumAllocatableRegisters = kNumRegisters - 176 static const int kNumAllocatableRegisters = kNumRegisters -
177 kNumReservedRegisters; 177 kNumReservedRegisters;
178 178
179 static int ToAllocationIndex(DwVfpRegister reg) { 179 static int ToAllocationIndex(DwVfpRegister reg) {
180 ASSERT(reg.code() != 0); 180 ASSERT(reg.code() != 14 && reg.code() != 15);
Vyacheslav Egorov (Chromium) 2012/01/10 15:28:27 I don't like this magic constants a bit.
181 return reg.code() - 1; 181 return reg.code();
182 } 182 }
183 183
184 static DwVfpRegister FromAllocationIndex(int index) { 184 static DwVfpRegister FromAllocationIndex(int index) {
185 ASSERT(index >= 0 && index < kNumAllocatableRegisters); 185 ASSERT(index >= 0 && index < kNumAllocatableRegisters);
186 return from_code(index + 1); 186 return from_code(index);
187 } 187 }
188 188
189 static const char* AllocationIndexToString(int index) { 189 static const char* AllocationIndexToString(int index) {
190 ASSERT(index >= 0 && index < kNumAllocatableRegisters); 190 ASSERT(index >= 0 && index < kNumAllocatableRegisters);
191 const char* const names[] = { 191 const char* const names[] = {
192 "d0", 192 "d0",
193 "d1", 193 "d1",
194 "d2", 194 "d2",
195 "d3", 195 "d3",
196 "d4", 196 "d4",
(...skipping 1216 matching lines...) Expand 10 before | Expand all | Expand 10 after
1413 public: 1413 public:
1414 explicit EnsureSpace(Assembler* assembler) { 1414 explicit EnsureSpace(Assembler* assembler) {
1415 assembler->CheckBuffer(); 1415 assembler->CheckBuffer();
1416 } 1416 }
1417 }; 1417 };
1418 1418
1419 1419
1420 } } // namespace v8::internal 1420 } } // namespace v8::internal
1421 1421
1422 #endif // V8_ARM_ASSEMBLER_ARM_H_ 1422 #endif // V8_ARM_ASSEMBLER_ARM_H_
OLDNEW
« no previous file with comments | « no previous file | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698