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

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

Issue 119082: Declare register names as static constants rather than external globals. (Closed) Base URL: http://v8.googlecode.com/svn/branches/bleeding_edge/
Patch Set: '' Created 11 years, 6 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 | « no previous file | src/ia32/assembler-ia32.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 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 61 matching lines...) Expand 10 before | Expand all | Expand 10 after
72 } 72 }
73 int bit() const { 73 int bit() const {
74 ASSERT(is_valid()); 74 ASSERT(is_valid());
75 return 1 << code_; 75 return 1 << code_;
76 } 76 }
77 77
78 // (unfortunately we can't make this private in a struct) 78 // (unfortunately we can't make this private in a struct)
79 int code_; 79 int code_;
80 }; 80 };
81 81
82 extern Register eax; 82 const Register eax = {0};
Kevin Millikin (Chromium) 2009/06/04 10:58:31 Format this one like the others.
83 extern Register ecx; 83 const Register ecx = { 1 };
84 extern Register edx; 84 const Register edx = { 2 };
85 extern Register ebx; 85 const Register ebx = { 3 };
86 extern Register esp; 86 const Register esp = { 4 };
87 extern Register ebp; 87 const Register ebp = { 5 };
88 extern Register esi; 88 const Register esi = { 6 };
89 extern Register edi; 89 const Register edi = { 7 };
90 extern Register no_reg; 90 const Register no_reg = { -1 };
91 91
92 92
93 struct XMMRegister { 93 struct XMMRegister {
94 bool is_valid() const { return 0 <= code_ && code_ < 2; } // currently 94 bool is_valid() const { return 0 <= code_ && code_ < 2; } // currently
95 int code() const { 95 int code() const {
96 ASSERT(is_valid()); 96 ASSERT(is_valid());
97 return code_; 97 return code_;
98 } 98 }
99 99
100 int code_; 100 int code_;
101 }; 101 };
102 102
103 extern XMMRegister xmm0; 103 const XMMRegister xmm0 = { 0 };
William Hesse 2009/06/04 10:49:51 OK, static const changed to const.
104 extern XMMRegister xmm1; 104 const XMMRegister xmm1 = { 1 };
105 extern XMMRegister xmm2; 105 const XMMRegister xmm2 = { 2 };
106 extern XMMRegister xmm3; 106 const XMMRegister xmm3 = { 3 };
107 extern XMMRegister xmm4; 107 const XMMRegister xmm4 = { 4 };
108 extern XMMRegister xmm5; 108 const XMMRegister xmm5 = { 5 };
109 extern XMMRegister xmm6; 109 const XMMRegister xmm6 = { 6 };
110 extern XMMRegister xmm7; 110 const XMMRegister xmm7 = { 7 };
111 111
112 enum Condition { 112 enum Condition {
113 // any value < 0 is considered no_condition 113 // any value < 0 is considered no_condition
114 no_condition = -1, 114 no_condition = -1,
115 115
116 overflow = 0, 116 overflow = 0,
117 no_overflow = 1, 117 no_overflow = 1,
118 below = 2, 118 below = 2,
119 above_equal = 3, 119 above_equal = 3,
120 equal = 4, 120 equal = 4,
(...skipping 734 matching lines...) Expand 10 before | Expand all | Expand 10 after
855 private: 855 private:
856 Assembler* assembler_; 856 Assembler* assembler_;
857 #ifdef DEBUG 857 #ifdef DEBUG
858 int space_before_; 858 int space_before_;
859 #endif 859 #endif
860 }; 860 };
861 861
862 } } // namespace v8::internal 862 } } // namespace v8::internal
863 863
864 #endif // V8_IA32_ASSEMBLER_IA32_H_ 864 #endif // V8_IA32_ASSEMBLER_IA32_H_
OLDNEW
« no previous file with comments | « no previous file | src/ia32/assembler-ia32.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698