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 int kRegister_rax_Code = 0; | 164 const Register rax = { 0 }; |
165 const int kRegister_rcx_Code = 1; | 165 const Register rcx = { 1 }; |
166 const int kRegister_rdx_Code = 2; | 166 const Register rdx = { 2 }; |
167 const int kRegister_rbx_Code = 3; | 167 const Register rbx = { 3 }; |
168 const int kRegister_rsp_Code = 4; | 168 const Register rsp = { 4 }; |
169 const int kRegister_rbp_Code = 5; | 169 const Register rbp = { 5 }; |
170 const int kRegister_rsi_Code = 6; | 170 const Register rsi = { 6 }; |
171 const int kRegister_rdi_Code = 7; | 171 const Register rdi = { 7 }; |
172 const int kRegister_r8_Code = 8; | 172 const Register r8 = { 8 }; |
173 const int kRegister_r9_Code = 9; | 173 const Register r9 = { 9 }; |
174 const int kRegister_r10_Code = 10; | 174 const Register r10 = { 10 }; |
175 const int kRegister_r11_Code = 11; | 175 const Register r11 = { 11 }; |
176 const int kRegister_r12_Code = 12; | 176 const Register r12 = { 12 }; |
177 const int kRegister_r13_Code = 13; | 177 const Register r13 = { 13 }; |
178 const int kRegister_r14_Code = 14; | 178 const Register r14 = { 14 }; |
179 const int kRegister_r15_Code = 15; | 179 const Register r15 = { 15 }; |
180 const int kRegister_no_reg_Code = -1; | 180 const Register no_reg = { -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 }; | |
199 | 181 |
200 | 182 |
201 struct XMMRegister { | 183 struct XMMRegister { |
202 static const int kNumRegisters = 16; | 184 static const int kNumRegisters = 16; |
203 static const int kNumAllocatableRegisters = 15; | 185 static const int kNumAllocatableRegisters = 15; |
204 | 186 |
205 static int ToAllocationIndex(XMMRegister reg) { | 187 static int ToAllocationIndex(XMMRegister reg) { |
206 ASSERT(reg.code() != 0); | 188 ASSERT(reg.code() != 0); |
207 return reg.code() - 1; | 189 return reg.code() - 1; |
208 } | 190 } |
(...skipping 1454 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1663 private: | 1645 private: |
1664 Assembler* assembler_; | 1646 Assembler* assembler_; |
1665 #ifdef DEBUG | 1647 #ifdef DEBUG |
1666 int space_before_; | 1648 int space_before_; |
1667 #endif | 1649 #endif |
1668 }; | 1650 }; |
1669 | 1651 |
1670 } } // namespace v8::internal | 1652 } } // namespace v8::internal |
1671 | 1653 |
1672 #endif // V8_X64_ASSEMBLER_X64_H_ | 1654 #endif // V8_X64_ASSEMBLER_X64_H_ |
OLD | NEW |