Commit 07f7388b authored by Sigurd Schneider's avatar Sigurd Schneider Committed by Commit Bot

[ia32,root] Preserve kRootRegister (ebx) in enter/leave code

This CL ensures that kRootRegister (ebx) is preserved in
BailoutOfDeoptimized and PopArgumentsAdaptorFrame.

This CL uses push/pop to preserve eax, even though it is not used in
OPTIMIZED_FUNCTION code. If we must get more performance, we might be
able to get rid of push/pop, but I've left it in because it is cleaner
code this way. Another alternative is to use ecx in case of embedded
builtins only (as it is used for speculation in the standard config).

Change-Id: I437c8754408414d82b2fbd8b33d2faeda17aee30
Bug: v8:6666
Reviewed-on: https://chromium-review.googlesource.com/1242886
Commit-Queue: Sigurd Schneider <sigurds@chromium.org>
Reviewed-by: 's avatarJaroslav Sevcik <jarin@chromium.org>
Cr-Commit-Position: refs/heads/master@{#56195}
parent 6b74c4bf
......@@ -500,7 +500,7 @@ void CodeGenerator::AssemblePopArgumentsAdaptorFrame(Register args_reg,
// There are not enough temp registers left on ia32 for a call instruction
// so we pick some scratch registers and save/restore them manually here.
int scratch_count = 3;
Register scratch1 = ebx;
Register scratch1 = esi;
Register scratch2 = ecx;
Register scratch3 = edx;
DCHECK(!AreAliased(args_reg, scratch1, scratch2, scratch3));
......@@ -624,9 +624,11 @@ void CodeGenerator::AssembleCodeStartRegisterCheck() {
// 3. if it is not zero then it jumps to the builtin.
void CodeGenerator::BailoutIfDeoptimized() {
int offset = Code::kCodeDataContainerOffset - Code::kHeaderSize;
__ mov(ebx, Operand(kJavaScriptCallCodeStartRegister, offset));
__ test(FieldOperand(ebx, CodeDataContainer::kKindSpecificFlagsOffset),
__ push(eax); // Push eax so we can use it as a scratch register.
__ mov(eax, Operand(kJavaScriptCallCodeStartRegister, offset));
__ test(FieldOperand(eax, CodeDataContainer::kKindSpecificFlagsOffset),
Immediate(1 << Code::kMarkedForDeoptimizationBit));
__ pop(eax); // Restore eax.
// Ensure we're not serializing (otherwise we'd need to use an indirection to
// access the builtin below).
DCHECK(!isolate()->ShouldLoadConstantsFromRootList());
......
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