OLD | NEW |
1 // Copyright 2009 the V8 project authors. All rights reserved. | 1 // Copyright 2009 the V8 project authors. All rights reserved. |
2 // Use of this source code is governed by a BSD-style license that can be | 2 // Use of this source code is governed by a BSD-style license that can be |
3 // found in the LICENSE file. | 3 // found in the LICENSE file. |
4 | 4 |
5 #if V8_TARGET_ARCH_ARM | 5 #if V8_TARGET_ARCH_ARM |
6 | 6 |
7 #include "src/arm/constants-arm.h" | 7 #include "src/arm/constants-arm.h" |
8 | 8 |
9 | 9 |
10 namespace v8 { | 10 namespace v8 { |
(...skipping 33 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
44 {10, "sl"}, | 44 {10, "sl"}, |
45 {11, "r11"}, | 45 {11, "r11"}, |
46 {12, "r12"}, | 46 {12, "r12"}, |
47 {13, "r13"}, | 47 {13, "r13"}, |
48 {14, "r14"}, | 48 {14, "r14"}, |
49 {15, "r15"}, | 49 {15, "r15"}, |
50 {kNoRegister, NULL} | 50 {kNoRegister, NULL} |
51 }; | 51 }; |
52 | 52 |
53 | 53 |
54 const char* Registers::Name(int reg) { | |
55 const char* result; | |
56 if ((0 <= reg) && (reg < kNumRegisters)) { | |
57 result = names_[reg]; | |
58 } else { | |
59 result = "noreg"; | |
60 } | |
61 return result; | |
62 } | |
63 | |
64 | |
65 // Support for VFP registers s0 to s31 (d0 to d15) and d16-d31. | 54 // Support for VFP registers s0 to s31 (d0 to d15) and d16-d31. |
66 // Note that "sN:sM" is the same as "dN/2" up to d15. | 55 // Note that "sN:sM" is the same as "dN/2" up to d15. |
67 // These register names are defined in a way to match the native disassembler | 56 // These register names are defined in a way to match the native disassembler |
68 // formatting. See for example the command "objdump -d <binary file>". | 57 // formatting. See for example the command "objdump -d <binary file>". |
69 const char* VFPRegisters::names_[kNumVFPRegisters] = { | 58 const char* VFPRegisters::names_[kNumVFPRegisters] = { |
70 "s0", "s1", "s2", "s3", "s4", "s5", "s6", "s7", | 59 "s0", "s1", "s2", "s3", "s4", "s5", "s6", "s7", |
71 "s8", "s9", "s10", "s11", "s12", "s13", "s14", "s15", | 60 "s8", "s9", "s10", "s11", "s12", "s13", "s14", "s15", |
72 "s16", "s17", "s18", "s19", "s20", "s21", "s22", "s23", | 61 "s16", "s17", "s18", "s19", "s20", "s21", "s22", "s23", |
73 "s24", "s25", "s26", "s27", "s28", "s29", "s30", "s31", | 62 "s24", "s25", "s26", "s27", "s28", "s29", "s30", "s31", |
74 "d0", "d1", "d2", "d3", "d4", "d5", "d6", "d7", | 63 "d0", "d1", "d2", "d3", "d4", "d5", "d6", "d7", |
(...skipping 46 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
121 | 110 |
122 // No register with the requested name found. | 111 // No register with the requested name found. |
123 return kNoRegister; | 112 return kNoRegister; |
124 } | 113 } |
125 | 114 |
126 | 115 |
127 } // namespace internal | 116 } // namespace internal |
128 } // namespace v8 | 117 } // namespace v8 |
129 | 118 |
130 #endif // V8_TARGET_ARCH_ARM | 119 #endif // V8_TARGET_ARCH_ARM |
OLD | NEW |