Commit 117d0dc4 authored by hpayer@chromium.org's avatar hpayer@chromium.org

Move allocation site pretenuring decision making to GC epilog.

BUG=
R=mvstanton@chromium.org

Review URL: https://codereview.chromium.org/149913005

git-svn-id: http://v8.googlecode.com/svn/branches/bleeding_edge@19270 ce2b1a6d-e550-0410-aec6-3dcde31c8c00
parent f3b95f11
......@@ -575,6 +575,9 @@ void Heap::GarbageCollectionEpilogue() {
ZapFromSpace();
}
// Process pretenuring feedback and update allocation sites.
ProcessPretenuringFeedback();
#ifdef VERIFY_HEAP
if (FLAG_verify_heap) {
Verify();
......@@ -1618,8 +1621,6 @@ void Heap::Scavenge() {
IncrementYoungSurvivorsCounter(static_cast<int>(
(PromotedSpaceSizeOfObjects() - survived_watermark) + new_space_.Size()));
ProcessPretenuringFeedback();
LOG(isolate_, ResourceEvent("scavenge", "end"));
gc_state_ = NOT_IN_GC;
......
......@@ -3385,13 +3385,6 @@ void MarkCompactCollector::EvacuateNewSpaceAndCandidates() {
EvacuateNewSpace();
}
// We have to travers our allocation sites scratchpad which contains raw
// pointers before we move objects. During new space evacauation we
// gathered pretenuring statistics. The found allocation sites may not be
// valid after compacting old space.
heap()->ProcessPretenuringFeedback();
{ GCTracer::Scope gc_scope(tracer_, GCTracer::Scope::MC_EVACUATE_PAGES);
EvacuatePages();
}
......
......@@ -11764,23 +11764,14 @@ bool DependentCode::MarkCodeForDeoptimization(
// Mark all the code that needs to be deoptimized.
bool marked = false;
for (int i = start; i < end; i++) {
Object* object = object_at(i);
// TODO(hpayer): This is a temporary hack. Foreign objects move after
// new space evacuation. Since pretenuring may mark these objects as aborted
// we have to follow the forwarding pointer in that case.
MapWord map_word = HeapObject::cast(object)->map_word();
if (map_word.IsForwardingAddress()) {
object = map_word.ToForwardingAddress();
}
if (object->IsCode()) {
Code* code = Code::cast(object);
if (is_code_at(i)) {
Code* code = code_at(i);
if (!code->marked_for_deoptimization()) {
code->set_marked_for_deoptimization(true);
marked = true;
}
} else {
CompilationInfo* info = reinterpret_cast<CompilationInfo*>(
Foreign::cast(object)->foreign_address());
CompilationInfo* info = compilation_info_at(i);
info->AbortDueToDependencyChange();
}
}
......
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