Commit 48ba97a4 authored by vegorov@chromium.org's avatar vegorov@chromium.org

Disable short-circuiting of cons-strings when compaction is pending.

Otherwise fast path of scavenger gets a bit too complicated and heavy.

R=mstarzinger@chromium.org

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

git-svn-id: http://v8.googlecode.com/svn/branches/bleeding_edge@9561 ce2b1a6d-e550-0410-aec6-3dcde31c8c00
parent 3b470c56
......@@ -1662,6 +1662,17 @@ void Heap::SelectScavengingVisitorsTable() {
ScavengingVisitor<TRANSFER_MARKS,
LOGGING_AND_PROFILING_ENABLED>::GetTable());
}
if (incremental_marking()->IsCompacting()) {
// When compacting forbid short-circuiting of cons-strings.
// Scavenging code relies on the fact that new space object
// can't be evacuated into evacuation candidate but
// short-circuiting violates this assumption.
scavenging_visitors_table_.Register(
StaticVisitorBase::kVisitShortcutCandidate,
scavenging_visitors_table_.GetVisitorById(
StaticVisitorBase::kVisitConsString));
}
}
}
......
......@@ -157,6 +157,10 @@ class VisitorDispatchTable {
}
}
inline Callback GetVisitorById(StaticVisitorBase::VisitorId id) {
return reinterpret_cast<Callback>(callbacks_[id]);
}
inline Callback GetVisitor(Map* map) {
return reinterpret_cast<Callback>(callbacks_[map->visitor_id()]);
}
......
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