OLD | NEW |
1 // Copyright 2010 the V8 project authors. All rights reserved. | 1 // Copyright 2010 the V8 project authors. All rights reserved. |
2 // Redistribution and use in source and binary forms, with or without | 2 // Redistribution and use in source and binary forms, with or without |
3 // modification, are permitted provided that the following conditions are | 3 // modification, are permitted provided that the following conditions are |
4 // met: | 4 // met: |
5 // | 5 // |
6 // * Redistributions of source code must retain the above copyright | 6 // * Redistributions of source code must retain the above copyright |
7 // notice, this list of conditions and the following disclaimer. | 7 // notice, this list of conditions and the following disclaimer. |
8 // * Redistributions in binary form must reproduce the above | 8 // * Redistributions in binary form must reproduce the above |
9 // copyright notice, this list of conditions and the following | 9 // copyright notice, this list of conditions and the following |
10 // disclaimer in the documentation and/or other materials provided | 10 // disclaimer in the documentation and/or other materials provided |
(...skipping 203 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
214 // Get the offset of the emitted safepoint table in the code. | 214 // Get the offset of the emitted safepoint table in the code. |
215 unsigned GetCodeOffset() const; | 215 unsigned GetCodeOffset() const; |
216 | 216 |
217 // Define a new safepoint for the current position in the body. | 217 // Define a new safepoint for the current position in the body. |
218 Safepoint DefineSafepoint( | 218 Safepoint DefineSafepoint( |
219 Assembler* assembler, | 219 Assembler* assembler, |
220 Safepoint::Kind kind, | 220 Safepoint::Kind kind, |
221 int arguments, | 221 int arguments, |
222 int deoptimization_index = Safepoint::kNoDeoptimizationIndex); | 222 int deoptimization_index = Safepoint::kNoDeoptimizationIndex); |
223 | 223 |
224 // Update the last safepoint with the size of the code generated for the gap | 224 // Update the last safepoint with the size of the code generated until the |
225 // following it. | 225 // end of the gap following it. |
226 void SetPcAfterGap(int pc) { | 226 void SetPcAfterGap(int pc) { |
227 ASSERT(!deoptimization_info_.is_empty()); | 227 ASSERT(!deoptimization_info_.is_empty()); |
228 int index = deoptimization_info_.length() - 1; | 228 int index = deoptimization_info_.length() - 1; |
229 deoptimization_info_[index].pc_after_gap = pc; | 229 deoptimization_info_[index].pc_after_gap = pc; |
230 } | 230 } |
231 | 231 |
232 // Emit the safepoint table after the body. The number of bits per | 232 // Emit the safepoint table after the body. The number of bits per |
233 // entry must be enough to hold all the pointer indexes. | 233 // entry must be enough to hold all the pointer indexes. |
234 void Emit(Assembler* assembler, int bits_per_entry); | 234 void Emit(Assembler* assembler, int bits_per_entry); |
235 | 235 |
| 236 // Count the number of deoptimization points where the next |
| 237 // following deoptimization point comes less than limit bytes |
| 238 // after the end of this point's gap. |
| 239 int CountShortDeoptimizationIntervals(unsigned limit); |
| 240 |
236 private: | 241 private: |
237 struct DeoptimizationInfo { | 242 struct DeoptimizationInfo { |
238 unsigned pc; | 243 unsigned pc; |
239 unsigned deoptimization_index; | 244 unsigned deoptimization_index; |
240 unsigned pc_after_gap; | 245 unsigned pc_after_gap; |
241 unsigned arguments; | 246 unsigned arguments; |
242 bool has_doubles; | 247 bool has_doubles; |
243 }; | 248 }; |
244 | 249 |
245 uint32_t EncodeExceptPC(const DeoptimizationInfo& info); | 250 uint32_t EncodeExceptPC(const DeoptimizationInfo& info); |
246 | 251 |
247 ZoneList<DeoptimizationInfo> deoptimization_info_; | 252 ZoneList<DeoptimizationInfo> deoptimization_info_; |
248 ZoneList<ZoneList<int>*> indexes_; | 253 ZoneList<ZoneList<int>*> indexes_; |
249 ZoneList<ZoneList<int>*> registers_; | 254 ZoneList<ZoneList<int>*> registers_; |
250 | 255 |
| 256 unsigned offset_; |
251 bool emitted_; | 257 bool emitted_; |
252 unsigned offset_; | |
253 | 258 |
254 DISALLOW_COPY_AND_ASSIGN(SafepointTableBuilder); | 259 DISALLOW_COPY_AND_ASSIGN(SafepointTableBuilder); |
255 }; | 260 }; |
256 | 261 |
257 } } // namespace v8::internal | 262 } } // namespace v8::internal |
258 | 263 |
259 #endif // V8_SAFEPOINT_TABLE_H_ | 264 #endif // V8_SAFEPOINT_TABLE_H_ |
OLD | NEW |