Commit 1bec4ad7 authored by hpayer@chromium.org's avatar hpayer@chromium.org

Check forwarding pointer when marking objects for deoptimization.

BUG=
R=bmeurer@chromium.org, mvstanton@chromium.org

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

git-svn-id: http://v8.googlecode.com/svn/branches/bleeding_edge@18973 ce2b1a6d-e550-0410-aec6-3dcde31c8c00
parent 0cb5fd3d
......@@ -11745,14 +11745,23 @@ bool DependentCode::MarkCodeForDeoptimization(
// Mark all the code that needs to be deoptimized.
bool marked = false;
for (int i = start; i < end; i++) {
if (is_code_at(i)) {
Code* code = code_at(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 (!code->marked_for_deoptimization()) {
code->set_marked_for_deoptimization(true);
marked = true;
}
} else {
CompilationInfo* info = compilation_info_at(i);
CompilationInfo* info = reinterpret_cast<CompilationInfo*>(
Foreign::cast(object)->foreign_address());
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