Chromium Code Reviews| Index: src/safepoint-table.cc |
| diff --git a/src/safepoint-table.cc b/src/safepoint-table.cc |
| index 153bf4327f672dd998190cef077f46ace7d1aad5..64b835a9508d1aeb2070985320665aefef24af89 100644 |
| --- a/src/safepoint-table.cc |
| +++ b/src/safepoint-table.cc |
| @@ -221,4 +221,25 @@ uint32_t SafepointTableBuilder::EncodeExceptPC(const DeoptimizationInfo& info) { |
| } |
| +int SafepointTableBuilder::CountShortDeoptimizationIntervals(unsigned limit) { |
| + int res = 0; |
|
fschneider
2011/02/02 12:54:16
small nit: result instead of res
Kevin Millikin (Chromium)
2011/02/02 13:05:33
No reason not to spell out 'result'.
Lasse Reichstein
2011/02/03 14:14:12
Done.
|
| + if (deoptimization_info_.length() > 0) { |
|
Kevin Millikin (Chromium)
2011/02/02 13:05:33
if (!deoptimization_info_.is_empty()) ...
Lasse Reichstein
2011/02/03 14:14:12
Done.
|
| + unsigned last_gap_end = deoptimization_info_[0].pc_after_gap; |
|
Kevin Millikin (Chromium)
2011/02/02 13:05:33
It's not necessarily the last one, it's the previo
Lasse Reichstein
2011/02/03 14:14:12
Ack. Pardon my bad Danglish.
(Not that it's even g
|
| + for (int i = 0, n = deoptimization_info_.length(); i < n; i++) { |
| + DeoptimizationInfo info = deoptimization_info_[i]; |
| + if (static_cast<int>(info.deoptimization_index) == |
|
Kevin Millikin (Chromium)
2011/02/02 13:05:33
It's probably clearer without the continue:
if (d
Lasse Reichstein
2011/02/03 14:14:12
Done.
|
| + Safepoint::kNoDeoptimizationIndex) { |
| + continue; |
| + } |
| + if (last_gap_end + limit > info.pc) { |
| + res++; |
| + } |
| + last_gap_end = info.pc_after_gap; |
| + } |
| + } |
| + return res; |
| +} |
| + |
| + |
| + |
| } } // namespace v8::internal |