Index: src/safepoint-table.cc |
diff --git a/src/safepoint-table.cc b/src/safepoint-table.cc |
index 4db3d9087595bfa68cb8b08ebbca204012390fdb..d418afd3ebbbeba0e62fbee32883fbc3f0b4ef61 100644 |
--- a/src/safepoint-table.cc |
+++ b/src/safepoint-table.cc |
@@ -230,4 +230,25 @@ uint32_t SafepointTableBuilder::EncodeExceptPC(const DeoptimizationInfo& info) { |
} |
+int SafepointTableBuilder::CountShortDeoptimizationIntervals(unsigned limit) { |
+ int result = 0; |
+ if (deoptimization_info_.length() > 0) { |
Kevin Millikin (Chromium)
2011/02/04 11:34:54
You can write "!deoptimization_info_.is_empty()".
Lasse Reichstein
2011/02/04 12:32:13
Done.
|
+ unsigned previous_gap_end = deoptimization_info_[0].pc_after_gap; |
+ for (int i = 1, n = deoptimization_info_.length(); i < n; i++) { |
+ DeoptimizationInfo info = deoptimization_info_[i]; |
+ if (static_cast<int>(info.deoptimization_index) == |
+ Safepoint::kNoDeoptimizationIndex) { |
+ continue; |
Kevin Millikin (Chromium)
2011/02/04 11:34:54
I'm still not thrilled about continue here. I wou
Lasse Reichstein
2011/02/04 12:32:13
Done.
|
+ } |
+ if (previous_gap_end + limit > info.pc) { |
+ result++; |
+ } |
+ previous_gap_end = info.pc_after_gap; |
+ } |
+ } |
+ return result; |
+} |
+ |
+ |
+ |
} } // namespace v8::internal |