| OLD | NEW |
| 1 // Copyright 2011 the V8 project authors. All rights reserved. | 1 // Copyright 2011 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 202 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 213 | 213 |
| 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(Assembler* assembler, | 218 Safepoint DefineSafepoint(Assembler* assembler, |
| 219 Safepoint::Kind kind, | 219 Safepoint::Kind kind, |
| 220 int arguments, | 220 int arguments, |
| 221 int deoptimization_index); | 221 int deoptimization_index); |
| 222 | 222 |
| 223 // Update the last safepoint with the size of the code generated for the gap | 223 // Update the last safepoint with the size of the code generated until the |
| 224 // following it. | 224 // end of the gap following it. |
| 225 void SetPcAfterGap(int pc) { | 225 void SetPcAfterGap(int pc) { |
| 226 ASSERT(!deoptimization_info_.is_empty()); | 226 ASSERT(!deoptimization_info_.is_empty()); |
| 227 int index = deoptimization_info_.length() - 1; | 227 int index = deoptimization_info_.length() - 1; |
| 228 deoptimization_info_[index].pc_after_gap = pc; | 228 deoptimization_info_[index].pc_after_gap = pc; |
| 229 } | 229 } |
| 230 | 230 |
| 231 // Emit the safepoint table after the body. The number of bits per | 231 // Emit the safepoint table after the body. The number of bits per |
| 232 // entry must be enough to hold all the pointer indexes. | 232 // entry must be enough to hold all the pointer indexes. |
| 233 void Emit(Assembler* assembler, int bits_per_entry); | 233 void Emit(Assembler* assembler, int bits_per_entry); |
| 234 | 234 |
| 235 // Count the number of deoptimization points where the next |
| 236 // following deoptimization point comes less than limit bytes |
| 237 // after the end of this point's gap. |
| 238 int CountShortDeoptimizationIntervals(unsigned limit); |
| 239 |
| 235 private: | 240 private: |
| 236 struct DeoptimizationInfo { | 241 struct DeoptimizationInfo { |
| 237 unsigned pc; | 242 unsigned pc; |
| 238 unsigned deoptimization_index; | 243 unsigned deoptimization_index; |
| 239 unsigned pc_after_gap; | 244 unsigned pc_after_gap; |
| 240 unsigned arguments; | 245 unsigned arguments; |
| 241 bool has_doubles; | 246 bool has_doubles; |
| 242 }; | 247 }; |
| 243 | 248 |
| 244 uint32_t EncodeExceptPC(const DeoptimizationInfo& info); | 249 uint32_t EncodeExceptPC(const DeoptimizationInfo& info); |
| 245 | 250 |
| 246 ZoneList<DeoptimizationInfo> deoptimization_info_; | 251 ZoneList<DeoptimizationInfo> deoptimization_info_; |
| 247 ZoneList<ZoneList<int>*> indexes_; | 252 ZoneList<ZoneList<int>*> indexes_; |
| 248 ZoneList<ZoneList<int>*> registers_; | 253 ZoneList<ZoneList<int>*> registers_; |
| 249 | 254 |
| 255 unsigned offset_; |
| 250 bool emitted_; | 256 bool emitted_; |
| 251 unsigned offset_; | |
| 252 | 257 |
| 253 DISALLOW_COPY_AND_ASSIGN(SafepointTableBuilder); | 258 DISALLOW_COPY_AND_ASSIGN(SafepointTableBuilder); |
| 254 }; | 259 }; |
| 255 | 260 |
| 256 } } // namespace v8::internal | 261 } } // namespace v8::internal |
| 257 | 262 |
| 258 #endif // V8_SAFEPOINT_TABLE_H_ | 263 #endif // V8_SAFEPOINT_TABLE_H_ |
| OLD | NEW |