Commit 5b8a6c1e authored by vegorov@chromium.org's avatar vegorov@chromium.org

Make heap iterable in PrepareForBreakPoints.

When aborting incremental marking with compaction discard all slots collected on evacuation candidates.

R=ricow@chromium.org
BUG=v8:1700
TEST=inspector/debugger/debugger-step-in.html

Review URL: http://codereview.chromium.org/7977004

git-svn-id: http://v8.googlecode.com/svn/branches/bleeding_edge@9360 ce2b1a6d-e550-0410-aec6-3dcde31c8c00
parent 647ad8f5
......@@ -1733,6 +1733,10 @@ void Debug::PrepareForBreakPoints() {
if (!has_break_points_) {
Deoptimizer::DeoptimizeAll();
// We are going to iterate heap to find all functions without
// debug break slots.
isolate_->heap()->CollectAllGarbage(Heap::kMakeHeapIterableMask);
AssertNoAllocation no_allocation;
Builtins* builtins = isolate_->builtins();
Code* lazy_compile = builtins->builtin(Builtins::kLazyCompile);
......
......@@ -258,6 +258,22 @@ bool MarkCompactCollector::StartCompaction() {
}
void MarkCompactCollector::AbortCompaction() {
if (compacting_) {
int npages = evacuation_candidates_.length();
for (int i = 0; i < npages; i++) {
Page* p = evacuation_candidates_[i];
slots_buffer_allocator_.DeallocateChain(p->slots_buffer_address());
p->ClearEvacuationCandidate();
p->ClearFlag(MemoryChunk::RESCAN_ON_EVACUATION);
}
compacting_ = false;
evacuation_candidates_.Rewind(0);
}
ASSERT_EQ(0, evacuation_candidates_.length());
}
void MarkCompactCollector::CollectGarbage() {
// Make sure that Prepare() has been called. The individual steps below will
// update the state as they proceed.
......@@ -478,6 +494,7 @@ void MarkCompactCollector::Prepare(GCTracer* tracer) {
if (heap()->incremental_marking()->IsMarking() && PreciseSweepingRequired()) {
heap()->incremental_marking()->Abort();
ClearMarkbits(heap_);
AbortCompaction();
}
if (!FLAG_never_compact) StartCompaction();
......
......@@ -449,6 +449,8 @@ class MarkCompactCollector {
bool StartCompaction();
void AbortCompaction();
// During a full GC, there is a stack-allocated GCTracer that is used for
// bookkeeping information. Return a pointer to that tracer.
GCTracer* tracer() { return tracer_; }
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment