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 140 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
151 private: | 151 private: |
152 AssemblerBase* assembler_; | 152 AssemblerBase* assembler_; |
153 bool old_value_; | 153 bool old_value_; |
154 }; | 154 }; |
155 | 155 |
156 | 156 |
157 // Avoids using instructions that vary in size in unpredictable ways between the | 157 // Avoids using instructions that vary in size in unpredictable ways between the |
158 // snapshot and the running VM. | 158 // snapshot and the running VM. |
159 class PredictableCodeSizeScope { | 159 class PredictableCodeSizeScope { |
160 public: | 160 public: |
| 161 explicit PredictableCodeSizeScope(AssemblerBase* assembler); |
161 PredictableCodeSizeScope(AssemblerBase* assembler, int expected_size); | 162 PredictableCodeSizeScope(AssemblerBase* assembler, int expected_size); |
162 ~PredictableCodeSizeScope(); | 163 ~PredictableCodeSizeScope(); |
| 164 void ExpectSize(int expected_size) { expected_size_ = expected_size; } |
163 | 165 |
164 private: | 166 private: |
165 AssemblerBase* assembler_; | 167 AssemblerBase* assembler_; |
166 int expected_size_; | 168 int expected_size_; |
167 int start_offset_; | 169 int start_offset_; |
168 bool old_value_; | 170 bool old_value_; |
169 }; | 171 }; |
170 | 172 |
171 | 173 |
172 // Enable a specified feature within a scope. | 174 // Enable a specified feature within a scope. |
(...skipping 1091 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1264 }; | 1266 }; |
1265 | 1267 |
1266 Label emitted_label_; // Records pc_offset of emitted pool | 1268 Label emitted_label_; // Records pc_offset of emitted pool |
1267 PerTypeEntryInfo info_[ConstantPoolEntry::NUMBER_OF_TYPES]; | 1269 PerTypeEntryInfo info_[ConstantPoolEntry::NUMBER_OF_TYPES]; |
1268 }; | 1270 }; |
1269 | 1271 |
1270 | 1272 |
1271 } } // namespace v8::internal | 1273 } } // namespace v8::internal |
1272 | 1274 |
1273 #endif // V8_ASSEMBLER_H_ | 1275 #endif // V8_ASSEMBLER_H_ |
OLD | NEW |