Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(310)

Unified Diff: src/safepoint-table.cc

Issue 8492004: Fix lazy deoptimization at HInvokeFunction and enable target-recording call-function stub. (Closed) Base URL: http://v8.googlecode.com/svn/branches/bleeding_edge/
Patch Set: added nop-padding and assertions on all platforms Created 9 years, 1 month ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « src/safepoint-table.h ('k') | src/x64/deoptimizer-x64.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: src/safepoint-table.cc
===================================================================
--- src/safepoint-table.cc (revision 9984)
+++ src/safepoint-table.cc (working copy)
@@ -122,17 +122,20 @@
Safepoint SafepointTableBuilder::DefineSafepoint(
- Assembler* assembler, Safepoint::Kind kind, int arguments,
- int deoptimization_index) {
- ASSERT(deoptimization_index != -1);
+ Assembler* assembler,
+ Safepoint::Kind kind,
+ int arguments,
+ Safepoint::DeoptMode deopt_mode) {
ASSERT(arguments >= 0);
- DeoptimizationInfo pc_and_deoptimization_index;
- pc_and_deoptimization_index.pc = assembler->pc_offset();
- pc_and_deoptimization_index.deoptimization_index = deoptimization_index;
- pc_and_deoptimization_index.pc_after_gap = assembler->pc_offset();
- pc_and_deoptimization_index.arguments = arguments;
- pc_and_deoptimization_index.has_doubles = (kind & Safepoint::kWithDoubles);
- deoptimization_info_.Add(pc_and_deoptimization_index);
+ DeoptimizationInfo info;
+ info.pc = assembler->pc_offset();
+ info.arguments = arguments;
+ info.has_doubles = (kind & Safepoint::kWithDoubles);
+ deoptimization_info_.Add(info);
+ deopt_index_list_.Add(Safepoint::kNoDeoptimizationIndex);
+ if (deopt_mode == Safepoint::kNoLazyDeopt) {
+ last_lazy_safepoint_ = deopt_index_list_.length();
+ }
indexes_.Add(new ZoneList<int>(8));
registers_.Add((kind & Safepoint::kWithRegisters)
? new ZoneList<int>(4)
@@ -141,6 +144,12 @@
}
+void SafepointTableBuilder::RecordLazyDeoptimizationIndex(int index) {
+ while (last_lazy_safepoint_ < deopt_index_list_.length()) {
+ deopt_index_list_[last_lazy_safepoint_++] = index;
+ }
+}
+
unsigned SafepointTableBuilder::GetCodeOffset() const {
ASSERT(emitted_);
return offset_;
@@ -173,11 +182,11 @@
assembler->dd(length);
assembler->dd(bytes_per_entry);
- // Emit sorted table of pc offsets together with deoptimization indexes and
- // pc after gap information.
+ // Emit sorted table of pc offsets together with deoptimization indexes.
for (int i = 0; i < length; i++) {
assembler->dd(deoptimization_info_[i].pc);
- assembler->dd(EncodeExceptPC(deoptimization_info_[i]));
+ assembler->dd(EncodeExceptPC(deoptimization_info_[i],
+ deopt_index_list_[i]));
}
// Emit table of bitmaps.
@@ -222,35 +231,14 @@
}
-uint32_t SafepointTableBuilder::EncodeExceptPC(const DeoptimizationInfo& info) {
- unsigned index = info.deoptimization_index;
- unsigned gap_size = info.pc_after_gap - info.pc;
+uint32_t SafepointTableBuilder::EncodeExceptPC(const DeoptimizationInfo& info,
+ unsigned index) {
uint32_t encoding = SafepointEntry::DeoptimizationIndexField::encode(index);
- encoding |= SafepointEntry::GapCodeSizeField::encode(gap_size);
encoding |= SafepointEntry::ArgumentsField::encode(info.arguments);
encoding |= SafepointEntry::SaveDoublesField::encode(info.has_doubles);
return encoding;
}
-int SafepointTableBuilder::CountShortDeoptimizationIntervals(unsigned limit) {
- int result = 0;
- if (!deoptimization_info_.is_empty()) {
- 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) {
- if (previous_gap_end + limit > info.pc) {
- result++;
- }
- previous_gap_end = info.pc_after_gap;
- }
- }
- }
- return result;
-}
-
-
} } // namespace v8::internal
« no previous file with comments | « src/safepoint-table.h ('k') | src/x64/deoptimizer-x64.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698