Reviewers: Michael Starzinger,
https://codereview.chromium.org/1225573002/diff/1/src/deoptimizer.cc
File src/deoptimizer.cc (right):
https://codereview.chromium.org/1225573002/diff/1/src/deoptimizer.cc#newcode422
src/deoptimizer.cc:422: // again that point to objects on evacuation
candidates.
On 2015/07/03 10:46:09, Michael Starzinger wrote:
nit: Let's add to the comment that this is only about slots in the
header of the
code object, not the instruction stream.
Done.
Description:
Record code slots that may point to evacuation candidate objects after
deoptimizing them.
BUG=506811
LOG=n
Please review this at https://codereview.chromium.org/1225573002/
Base URL: https://chromium.googlesource.com/v8/v8.git@master
Affected files (+27, -0 lines):
M src/deoptimizer.cc
M src/heap/mark-compact.h
M src/heap/mark-compact.cc
Index: src/deoptimizer.cc
diff --git a/src/deoptimizer.cc b/src/deoptimizer.cc
index
3ab10fcac905871da62fafd9cf9f658e1e7e7d48..080ac2ef30cb2472ff7ef7721b17c554571271bf
100644
--- a/src/deoptimizer.cc
+++ b/src/deoptimizer.cc
@@ -417,6 +417,11 @@ void
Deoptimizer::DeoptimizeMarkedCodeForContext(Context* context) {
// Ignore all slots that might have been recorded on the deoptimized
code
// object.
isolate->heap()->mark_compact_collector()->RemoveObjectSlots(codes[i]);
+
+ // After removing all recorded slots of the code object, we add the
slots
+ // again that point to objects on evacuation candidates.
+ isolate->heap()->mark_compact_collector()->RecordDeoptimizedCodeSlots(
+ codes[i]);
}
}
Index: src/heap/mark-compact.cc
diff --git a/src/heap/mark-compact.cc b/src/heap/mark-compact.cc
index
db7b427458ef841d29dd374fae2b8f98a9c1b27a..fe18b8a2c48dea8069a1fb78b3909bc07e33e1a4
100644
--- a/src/heap/mark-compact.cc
+++ b/src/heap/mark-compact.cc
@@ -3251,6 +3251,24 @@ void
MarkCompactCollector::RemoveObjectSlots(HeapObject* invalid_object) {
}
+void MarkCompactCollector::RecordDeoptimizedCodeSlots(Code* code) {
+ Object** reloc_info_slot = Code::RawField(code,
Code::kRelocationInfoOffset);
+ RecordSlot(reloc_info_slot, reloc_info_slot, *reloc_info_slot);
+ Object** handler_table_slot = Code::RawField(code,
Code::kHandlerTableOffset);
+ RecordSlot(handler_table_slot, handler_table_slot, *handler_table_slot);
+ Object** deopt_data_slot =
+ Code::RawField(code, Code::kDeoptimizationDataOffset);
+ RecordSlot(deopt_data_slot, deopt_data_slot, *deopt_data_slot);
+ Object** type_feedback_slot =
+ Code::RawField(code, Code::kTypeFeedbackInfoOffset);
+ RecordSlot(type_feedback_slot, type_feedback_slot, *type_feedback_slot);
+ Object** next_code_slot = Code::RawField(code,
Code::kNextCodeLinkOffset);
+ RecordSlot(next_code_slot, next_code_slot, *next_code_slot);
+ Object** meta_data_slot = Code::RawField(code, Code::kGCMetadataOffset);
+ RecordSlot(meta_data_slot, meta_data_slot, *meta_data_slot);
+}
+
+
void MarkCompactCollector::EvacuateNewSpace() {
// There are soft limits in the allocation code, designed trigger a mark
// sweep collection by failing allocations. But since we are already in
Index: src/heap/mark-compact.h
diff --git a/src/heap/mark-compact.h b/src/heap/mark-compact.h
index
3db029e61021f87628087d286fefec3c89e1bf86..4812f86a455fe1e9b244e89b391430e82c0dd9a4
100644
--- a/src/heap/mark-compact.h
+++ b/src/heap/mark-compact.h
@@ -745,6 +745,10 @@ class MarkCompactCollector {
// invalid_object.
void RemoveObjectSlots(HeapObject* invalid_object);
+ // Record slots of deoptimized code object header that may point to
evacuation
+ // candidates.
+ void RecordDeoptimizedCodeSlots(Code* code);
+
private:
class SweeperTask;
--
--
v8-dev mailing list
[email protected]
http://groups.google.com/group/v8-dev
---
You received this message because you are subscribed to the Google Groups "v8-dev" group.
To unsubscribe from this group and stop receiving emails from it, send an email
to [email protected].
For more options, visit https://groups.google.com/d/optout.