OLD | NEW |
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 are | 5 // modification, are permitted provided that the following conditions are |
6 // met: | 6 // 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 143 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
154 | 154 |
155 // Unfortunately we can't make this private in a struct when initializing | 155 // Unfortunately we can't make this private in a struct when initializing |
156 // by assignment. | 156 // by assignment. |
157 int code_; | 157 int code_; |
158 | 158 |
159 private: | 159 private: |
160 static const int kRegisterCodeByAllocationIndex[kNumAllocatableRegisters]; | 160 static const int kRegisterCodeByAllocationIndex[kNumAllocatableRegisters]; |
161 static const int kAllocationIndexByRegisterCode[kNumRegisters]; | 161 static const int kAllocationIndexByRegisterCode[kNumRegisters]; |
162 }; | 162 }; |
163 | 163 |
164 const Register rax = { 0 }; | 164 const int kRegister_rax_Code = 0; |
165 const Register rcx = { 1 }; | 165 const int kRegister_rcx_Code = 1; |
166 const Register rdx = { 2 }; | 166 const int kRegister_rdx_Code = 2; |
167 const Register rbx = { 3 }; | 167 const int kRegister_rbx_Code = 3; |
168 const Register rsp = { 4 }; | 168 const int kRegister_rsp_Code = 4; |
169 const Register rbp = { 5 }; | 169 const int kRegister_rbp_Code = 5; |
170 const Register rsi = { 6 }; | 170 const int kRegister_rsi_Code = 6; |
171 const Register rdi = { 7 }; | 171 const int kRegister_rdi_Code = 7; |
172 const Register r8 = { 8 }; | 172 const int kRegister_r8_Code = 8; |
173 const Register r9 = { 9 }; | 173 const int kRegister_r9_Code = 9; |
174 const Register r10 = { 10 }; | 174 const int kRegister_r10_Code = 10; |
175 const Register r11 = { 11 }; | 175 const int kRegister_r11_Code = 11; |
176 const Register r12 = { 12 }; | 176 const int kRegister_r12_Code = 12; |
177 const Register r13 = { 13 }; | 177 const int kRegister_r13_Code = 13; |
178 const Register r14 = { 14 }; | 178 const int kRegister_r14_Code = 14; |
179 const Register r15 = { 15 }; | 179 const int kRegister_r15_Code = 15; |
180 const Register no_reg = { -1 }; | 180 const int kRegister_no_reg_Code = -1; |
| 181 |
| 182 const Register rax = { kRegister_rax_Code }; |
| 183 const Register rcx = { kRegister_rcx_Code }; |
| 184 const Register rdx = { kRegister_rdx_Code }; |
| 185 const Register rbx = { kRegister_rbx_Code }; |
| 186 const Register rsp = { kRegister_rsp_Code }; |
| 187 const Register rbp = { kRegister_rbp_Code }; |
| 188 const Register rsi = { kRegister_rsi_Code }; |
| 189 const Register rdi = { kRegister_rdi_Code }; |
| 190 const Register r8 = { kRegister_r8_Code }; |
| 191 const Register r9 = { kRegister_r9_Code }; |
| 192 const Register r10 = { kRegister_r10_Code }; |
| 193 const Register r11 = { kRegister_r11_Code }; |
| 194 const Register r12 = { kRegister_r12_Code }; |
| 195 const Register r13 = { kRegister_r13_Code }; |
| 196 const Register r14 = { kRegister_r14_Code }; |
| 197 const Register r15 = { kRegister_r15_Code }; |
| 198 const Register no_reg = { kRegister_no_reg_Code }; |
181 | 199 |
182 | 200 |
183 struct XMMRegister { | 201 struct XMMRegister { |
184 static const int kNumRegisters = 16; | 202 static const int kNumRegisters = 16; |
185 static const int kNumAllocatableRegisters = 15; | 203 static const int kNumAllocatableRegisters = 15; |
186 | 204 |
187 static int ToAllocationIndex(XMMRegister reg) { | 205 static int ToAllocationIndex(XMMRegister reg) { |
188 ASSERT(reg.code() != 0); | 206 ASSERT(reg.code() != 0); |
189 return reg.code() - 1; | 207 return reg.code() - 1; |
190 } | 208 } |
(...skipping 1455 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1646 private: | 1664 private: |
1647 Assembler* assembler_; | 1665 Assembler* assembler_; |
1648 #ifdef DEBUG | 1666 #ifdef DEBUG |
1649 int space_before_; | 1667 int space_before_; |
1650 #endif | 1668 #endif |
1651 }; | 1669 }; |
1652 | 1670 |
1653 } } // namespace v8::internal | 1671 } } // namespace v8::internal |
1654 | 1672 |
1655 #endif // V8_X64_ASSEMBLER_X64_H_ | 1673 #endif // V8_X64_ASSEMBLER_X64_H_ |
OLD | NEW |