Commit 1320c917 authored by Ulan Degenbaev's avatar Ulan Degenbaev Committed by Commit Bot

[snapshot] Fix clearing of feedback vector in serializer (follow-up 2)

Bug: v8:7857
Change-Id: I3940ae2830adb6c572e079551b7bba7d84462afd
Reviewed-on: https://chromium-review.googlesource.com/c/v8/v8/+/1715444Reviewed-by: 's avatarRoss McIlroy <rmcilroy@chromium.org>
Commit-Queue: Ulan Degenbaev <ulan@chromium.org>
Cr-Commit-Position: refs/heads/master@{#62881}
parent 0edea399
......@@ -811,15 +811,10 @@ StartupData SnapshotCreator::CreateBlob(
// Complete in-object slack tracking for all functions.
fun.CompleteInobjectSlackTrackingIfActive();
fun.ResetIfBytecodeFlushed();
// Also, clear out feedback vectors, or any optimized code.
// Note that checking for fun.IsOptimized() || fun.IsInterpreted() is not
// sufficient because the function can have a feedback vector even if it
// is not compiled (e.g. when the bytecode was flushed). On the other
// hand, only checking for the feedback vector is not sufficient because
// there can be multiple functions sharing the same feedback vector. So we
// need all these checks.
if (fun.IsOptimized() || fun.IsInterpreted() ||
!fun.raw_feedback_cell().value().IsUndefined()) {
if (fun.IsOptimized() || fun.IsInterpreted()) {
fun.raw_feedback_cell().set_value(
i::ReadOnlyRoots(isolate).undefined_value());
fun.set_code(isolate->builtins()->builtin(i::Builtins::kCompileLazy));
......
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