[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: Michael Stanton <mvstanton@chromium.org>
Cr-Commit-Position: refs/heads/master@{#51397}
This commit is contained in:
Michael Starzinger 2018-02-20 15:45:59 +01:00 committed by Commit Bot
parent 6e547e907e
commit 5a4af7c142
2 changed files with 10 additions and 8 deletions

View File

@ -385,10 +385,11 @@ void CEntryStub::Generate(MacroAssembler* masm) {
__ cmp(cp, Operand(0));
__ str(cp, MemOperand(fp, StandardFrameConstants::kContextOffset), ne);
// Reset the masking register.
if (FLAG_branch_load_poisoning) {
__ ResetSpeculationPoisonRegister();
}
// Reset the masking register. This is done independent of the underlying
// 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();
// Compute the handler entry address and jump to it.
ConstantPoolUnavailableScope constant_pool_unavailable(masm);

View File

@ -425,10 +425,11 @@ void CEntryStub::Generate(MacroAssembler* masm) {
__ movp(Operand(rbp, StandardFrameConstants::kContextOffset), rsi);
__ bind(&skip);
// Reset the masking register.
if (FLAG_branch_load_poisoning) {
__ ResetSpeculationPoisonRegister();
}
// Reset the masking register. This is done independent of the underlying
// 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();
// Compute the handler entry address and jump to it.
__ movp(rdi, masm->ExternalOperand(pending_handler_entrypoint_address));