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

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

Issue 9455088: Remove static initializers in v8. (Closed) Base URL: http://v8.googlecode.com/svn/branches/bleeding_edge
Patch Set: Address Florian and Sven 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
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 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 79 matching lines...) Expand 10 before | Expand all | Expand 10 after
90 } 90 }
91 int bit() const { 91 int bit() const {
92 ASSERT(is_valid()); 92 ASSERT(is_valid());
93 return 1 << code_; 93 return 1 << code_;
94 } 94 }
95 95
96 // Unfortunately we can't make this private in a struct. 96 // Unfortunately we can't make this private in a struct.
97 int code_; 97 int code_;
98 }; 98 };
99 99
100 const int kRegisterEaxCode = 0;
101 const int kRegisterEcxCode = 1;
102 const int kRegisterEdxCode = 2;
103 const int kRegisterEbxCode = 3;
104 const int kRegisterEspCode = 4;
105 const int kRegisterEbpCode = 5;
106 const int kRegisterEsiCode = 6;
107 const int kRegisterEdiCode = 7;
108 const int kRegisterNoneCode = -1;
100 109
101 const Register eax = { 0 }; 110 const Register eax = { kRegisterEaxCode };
102 const Register ecx = { 1 }; 111 const Register ecx = { kRegisterEcxCode };
103 const Register edx = { 2 }; 112 const Register edx = { kRegisterEdxCode };
104 const Register ebx = { 3 }; 113 const Register ebx = { kRegisterEbxCode };
105 const Register esp = { 4 }; 114 const Register esp = { kRegisterEspCode };
106 const Register ebp = { 5 }; 115 const Register ebp = { kRegisterEbpCode };
107 const Register esi = { 6 }; 116 const Register esi = { kRegisterEsiCode };
108 const Register edi = { 7 }; 117 const Register edi = { kRegisterEdiCode };
109 const Register no_reg = { -1 }; 118 const Register no_reg = { kRegisterNoneCode };
110 119
111 120
112 inline const char* Register::AllocationIndexToString(int index) { 121 inline const char* Register::AllocationIndexToString(int index) {
113 ASSERT(index >= 0 && index < kNumAllocatableRegisters); 122 ASSERT(index >= 0 && index < kNumAllocatableRegisters);
114 // This is the mapping of allocation indices to registers. 123 // This is the mapping of allocation indices to registers.
115 const char* const kNames[] = { "eax", "ecx", "edx", "ebx", "esi", "edi" }; 124 const char* const kNames[] = { "eax", "ecx", "edx", "ebx", "esi", "edi" };
116 return kNames[index]; 125 return kNames[index];
117 } 126 }
118 127
119 128
(...skipping 1083 matching lines...) Expand 10 before | Expand all | Expand 10 after
1203 private: 1212 private:
1204 Assembler* assembler_; 1213 Assembler* assembler_;
1205 #ifdef DEBUG 1214 #ifdef DEBUG
1206 int space_before_; 1215 int space_before_;
1207 #endif 1216 #endif
1208 }; 1217 };
1209 1218
1210 } } // namespace v8::internal 1219 } } // namespace v8::internal
1211 1220
1212 #endif // V8_IA32_ASSEMBLER_IA32_H_ 1221 #endif // V8_IA32_ASSEMBLER_IA32_H_
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698