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 | 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 106 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
117 | 117 |
118 void set_code(int code) { | 118 void set_code(int code) { |
119 code_ = code; | 119 code_ = code; |
120 ASSERT(is_valid()); | 120 ASSERT(is_valid()); |
121 } | 121 } |
122 | 122 |
123 // Unfortunately we can't make this private in a struct. | 123 // Unfortunately we can't make this private in a struct. |
124 int code_; | 124 int code_; |
125 }; | 125 }; |
126 | 126 |
127 // These constants are used in several locations, including static initializers | 127 const Register no_reg = { -1 }; |
128 const int kRegister_no_reg_Code = -1; | |
129 const int kRegister_r0_Code = 0; | |
130 const int kRegister_r1_Code = 1; | |
131 const int kRegister_r2_Code = 2; | |
132 const int kRegister_r3_Code = 3; | |
133 const int kRegister_r4_Code = 4; | |
134 const int kRegister_r5_Code = 5; | |
135 const int kRegister_r6_Code = 6; | |
136 const int kRegister_r7_Code = 7; | |
137 const int kRegister_r8_Code = 8; | |
138 const int kRegister_r9_Code = 9; | |
139 const int kRegister_r10_Code = 10; | |
140 const int kRegister_fp_Code = 11; | |
141 const int kRegister_ip_Code = 12; | |
142 const int kRegister_sp_Code = 13; | |
143 const int kRegister_lr_Code = 14; | |
144 const int kRegister_pc_Code = 15; | |
145 | 128 |
146 const Register no_reg = { kRegister_no_reg_Code }; | 129 const Register r0 = { 0 }; |
147 | 130 const Register r1 = { 1 }; |
148 const Register r0 = { kRegister_r0_Code }; | 131 const Register r2 = { 2 }; |
149 const Register r1 = { kRegister_r1_Code }; | 132 const Register r3 = { 3 }; |
150 const Register r2 = { kRegister_r2_Code }; | 133 const Register r4 = { 4 }; |
151 const Register r3 = { kRegister_r3_Code }; | 134 const Register r5 = { 5 }; |
152 const Register r4 = { kRegister_r4_Code }; | 135 const Register r6 = { 6 }; |
153 const Register r5 = { kRegister_r5_Code }; | 136 const Register r7 = { 7 }; |
154 const Register r6 = { kRegister_r6_Code }; | 137 const Register r8 = { 8 }; // Used as context register. |
155 const Register r7 = { kRegister_r7_Code }; | 138 const Register r9 = { 9 }; // Used as lithium codegen scratch register. |
156 // Used as context register. | 139 const Register r10 = { 10 }; // Used as roots register. |
157 const Register r8 = { kRegister_r8_Code }; | 140 const Register fp = { 11 }; |
158 // Used as lithium codegen scratch register. | 141 const Register ip = { 12 }; |
159 const Register r9 = { kRegister_r9_Code }; | 142 const Register sp = { 13 }; |
160 // Used as roots register. | 143 const Register lr = { 14 }; |
161 const Register r10 = { kRegister_r10_Code }; | 144 const Register pc = { 15 }; |
162 const Register fp = { kRegister_fp_Code }; | |
163 const Register ip = { kRegister_ip_Code }; | |
164 const Register sp = { kRegister_sp_Code }; | |
165 const Register lr = { kRegister_lr_Code }; | |
166 const Register pc = { kRegister_pc_Code }; | |
167 | |
168 | 145 |
169 // Single word VFP register. | 146 // Single word VFP register. |
170 struct SwVfpRegister { | 147 struct SwVfpRegister { |
171 bool is_valid() const { return 0 <= code_ && code_ < 32; } | 148 bool is_valid() const { return 0 <= code_ && code_ < 32; } |
172 bool is(SwVfpRegister reg) const { return code_ == reg.code_; } | 149 bool is(SwVfpRegister reg) const { return code_ == reg.code_; } |
173 int code() const { | 150 int code() const { |
174 ASSERT(is_valid()); | 151 ASSERT(is_valid()); |
175 return code_; | 152 return code_; |
176 } | 153 } |
177 int bit() const { | 154 int bit() const { |
(...skipping 1257 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1435 public: | 1412 public: |
1436 explicit EnsureSpace(Assembler* assembler) { | 1413 explicit EnsureSpace(Assembler* assembler) { |
1437 assembler->CheckBuffer(); | 1414 assembler->CheckBuffer(); |
1438 } | 1415 } |
1439 }; | 1416 }; |
1440 | 1417 |
1441 | 1418 |
1442 } } // namespace v8::internal | 1419 } } // namespace v8::internal |
1443 | 1420 |
1444 #endif // V8_ARM_ASSEMBLER_ARM_H_ | 1421 #endif // V8_ARM_ASSEMBLER_ARM_H_ |
OLD | NEW |