Commit 5a4af7c1 authored by Michael Starzinger's avatar Michael Starzinger Committed by Commit Bot

[turbofan] Make --branch-load-poisoning work with stock snapshot.

This makes sure that an existing unmodified snapshot works together with
the --branch-load-poisoning feature by unconditionally resetting the
underlying register in {CEntryStub::Generate}.

R=mvstanton@chromium.org

Change-Id: I4d9f12a3b45bd7b46eda55a342beadf9b9a4bb8a
Reviewed-on: https://chromium-review.googlesource.com/926365
Commit-Queue: Michael Starzinger <mstarzinger@chromium.org>
Reviewed-by: 's avatarMichael Stanton <mvstanton@chromium.org>
Cr-Commit-Position: refs/heads/master@{#51397}
parent 6e547e90
...@@ -385,10 +385,11 @@ void CEntryStub::Generate(MacroAssembler* masm) { ...@@ -385,10 +385,11 @@ void CEntryStub::Generate(MacroAssembler* masm) {
__ cmp(cp, Operand(0)); __ cmp(cp, Operand(0));
__ str(cp, MemOperand(fp, StandardFrameConstants::kContextOffset), ne); __ str(cp, MemOperand(fp, StandardFrameConstants::kContextOffset), ne);
// Reset the masking register. // Reset the masking register. This is done independent of the underlying
if (FLAG_branch_load_poisoning) { // feature flag {FLAG_branch_load_poisoning} to make the snapshot work with
// both configurations. It is safe to always do this, because the underlying
// register is caller-saved and can be arbitrarily clobbered.
__ ResetSpeculationPoisonRegister(); __ ResetSpeculationPoisonRegister();
}
// Compute the handler entry address and jump to it. // Compute the handler entry address and jump to it.
ConstantPoolUnavailableScope constant_pool_unavailable(masm); ConstantPoolUnavailableScope constant_pool_unavailable(masm);
......
...@@ -425,10 +425,11 @@ void CEntryStub::Generate(MacroAssembler* masm) { ...@@ -425,10 +425,11 @@ void CEntryStub::Generate(MacroAssembler* masm) {
__ movp(Operand(rbp, StandardFrameConstants::kContextOffset), rsi); __ movp(Operand(rbp, StandardFrameConstants::kContextOffset), rsi);
__ bind(&skip); __ bind(&skip);
// Reset the masking register. // Reset the masking register. This is done independent of the underlying
if (FLAG_branch_load_poisoning) { // feature flag {FLAG_branch_load_poisoning} to make the snapshot work with
// both configurations. It is safe to always do this, because the underlying
// register is caller-saved and can be arbitrarily clobbered.
__ ResetSpeculationPoisonRegister(); __ ResetSpeculationPoisonRegister();
}
// Compute the handler entry address and jump to it. // Compute the handler entry address and jump to it.
__ movp(rdi, masm->ExternalOperand(pending_handler_entrypoint_address)); __ movp(rdi, masm->ExternalOperand(pending_handler_entrypoint_address));
......
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