[root] Reinitialize root register in deoptimizer

Bug: v8:6666, v8:7777
Change-Id: I0d1306bb96e12c81e876888b0ca69cae5855fbc3
Reviewed-on: https://chromium-review.googlesource.com/c/1273100
Reviewed-by: Jaroslav Sevcik <jarin@chromium.org>
Reviewed-by: Jakob Gruber <jgruber@chromium.org>
Commit-Queue: Sigurd Schneider <sigurds@chromium.org>
Cr-Commit-Position: refs/heads/master@{#56678}
This commit is contained in:
Sigurd Schneider 2018-10-15 17:21:02 +02:00 committed by Commit Bot
parent 1e586c3c70
commit 18c135b1a4
8 changed files with 14 additions and 14 deletions

View File

@ -221,8 +221,6 @@ void Deoptimizer::TableEntryGenerator::Generate() {
// Restore the registers from the stack.
__ ldm(ia_w, sp, restored_regs); // all but pc registers.
__ InitializeRootRegister();
// Remove sp, lr and pc.
__ Drop(3);
{

View File

@ -271,7 +271,6 @@ void Deoptimizer::TableEntryGenerator::Generate() {
__ Ldr(continuation, MemOperand(last_output_frame,
FrameDescription::continuation_offset()));
__ Ldr(lr, MemOperand(last_output_frame, FrameDescription::pc_offset()));
__ InitializeRootRegister();
__ Br(continuation);
}

View File

@ -809,6 +809,20 @@ void Deoptimizer::DoComputeOutputFrames() {
}
}
#if defined(V8_TARGET_ARCH_IA32)
constexpr bool kShouldInitializeRootRegister = FLAG_embedded_builtins;
#else
constexpr bool kShouldInitializeRootRegister = true;
#endif
if (kShouldInitializeRootRegister) {
Address root_pointer =
reinterpret_cast<Address>(isolate()->roots_array_start()) +
kRootRegisterBias;
FrameDescription* topmost = output_[count - 1];
topmost->GetRegisterValues()->SetRegister(kRootRegister.code(),
root_pointer);
}
// Print some helpful diagnostic information.
if (trace_scope_ != nullptr) {
double ms = timer.Elapsed().InMillisecondsF();

View File

@ -226,8 +226,6 @@ void Deoptimizer::TableEntryGenerator::Generate() {
}
}
__ InitializeRootRegister();
__ pop(at); // Get continuation, leave pc on stack.
__ pop(ra);
__ Jump(at);

View File

@ -224,8 +224,6 @@ void Deoptimizer::TableEntryGenerator::Generate() {
}
}
__ InitializeRootRegister();
__ pop(at); // Get continuation, leave pc on stack.
__ pop(ra);
__ Jump(at);

View File

@ -218,8 +218,6 @@ void Deoptimizer::TableEntryGenerator::Generate() {
}
}
__ InitializeRootRegister();
__ pop(ip); // get continuation, leave pc on stack
__ pop(r0);
__ mtlr(r0);

View File

@ -224,8 +224,6 @@ void Deoptimizer::TableEntryGenerator::Generate() {
}
}
__ InitializeRootRegister();
__ pop(ip); // get continuation, leave pc on stack
__ pop(r14);
__ Jump(ip);

View File

@ -234,9 +234,6 @@ void Deoptimizer::TableEntryGenerator::Generate() {
__ popq(r);
}
// Set up the roots register.
__ InitializeRootRegister();
// Return to the continuation point.
__ ret(0);
}