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

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

Issue 9455088: Remove static initializers in v8. (Closed) Base URL: http://v8.googlecode.com/svn/branches/bleeding_edge
Patch Set: Address Florian's comments. Created 8 years, 9 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 | « src/api.cc ('k') | src/arm/assembler-arm.cc » ('j') | 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 106 matching lines...) Expand 10 before | Expand all | Expand 10 after
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 const Register no_reg = { -1 }; 127 // These constants are used in several locations, including static initializers
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;
128 145
129 const Register r0 = { 0 }; 146 const Register no_reg = { kRegister_no_reg_Code };
130 const Register r1 = { 1 }; 147
131 const Register r2 = { 2 }; 148 const Register r0 = { kRegister_r0_Code };
132 const Register r3 = { 3 }; 149 const Register r1 = { kRegister_r1_Code };
133 const Register r4 = { 4 }; 150 const Register r2 = { kRegister_r2_Code };
134 const Register r5 = { 5 }; 151 const Register r3 = { kRegister_r3_Code };
135 const Register r6 = { 6 }; 152 const Register r4 = { kRegister_r4_Code };
136 const Register r7 = { 7 }; 153 const Register r5 = { kRegister_r5_Code };
137 const Register r8 = { 8 }; // Used as context register. 154 const Register r6 = { kRegister_r6_Code };
138 const Register r9 = { 9 }; // Used as lithium codegen scratch register. 155 const Register r7 = { kRegister_r7_Code };
139 const Register r10 = { 10 }; // Used as roots register. 156 // Used as context register.
140 const Register fp = { 11 }; 157 const Register r8 = { kRegister_r8_Code };
141 const Register ip = { 12 }; 158 // Used as lithium codegen scratch register.
142 const Register sp = { 13 }; 159 const Register r9 = { kRegister_r9_Code };
143 const Register lr = { 14 }; 160 // Used as roots register.
144 const Register pc = { 15 }; 161 const Register r10 = { kRegister_r10_Code };
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
145 168
146 // Single word VFP register. 169 // Single word VFP register.
147 struct SwVfpRegister { 170 struct SwVfpRegister {
148 bool is_valid() const { return 0 <= code_ && code_ < 32; } 171 bool is_valid() const { return 0 <= code_ && code_ < 32; }
149 bool is(SwVfpRegister reg) const { return code_ == reg.code_; } 172 bool is(SwVfpRegister reg) const { return code_ == reg.code_; }
150 int code() const { 173 int code() const {
151 ASSERT(is_valid()); 174 ASSERT(is_valid());
152 return code_; 175 return code_;
153 } 176 }
154 int bit() const { 177 int bit() const {
(...skipping 1258 matching lines...) Expand 10 before | Expand all | Expand 10 after
1413 public: 1436 public:
1414 explicit EnsureSpace(Assembler* assembler) { 1437 explicit EnsureSpace(Assembler* assembler) {
1415 assembler->CheckBuffer(); 1438 assembler->CheckBuffer();
1416 } 1439 }
1417 }; 1440 };
1418 1441
1419 1442
1420 } } // namespace v8::internal 1443 } } // namespace v8::internal
1421 1444
1422 #endif // V8_ARM_ASSEMBLER_ARM_H_ 1445 #endif // V8_ARM_ASSEMBLER_ARM_H_
OLDNEW
« no previous file with comments | « src/api.cc ('k') | src/arm/assembler-arm.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698