Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(530)

Unified Diff: src/crankshaft/x64/lithium-codegen-x64.cc

Issue 2090023002: Version 5.2.361.24 (cherry-pick) (Closed) Base URL: https://chromium.googlesource.com/v8/v8.git@5.2
Patch Set: Created 4 years, 6 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « src/crankshaft/ia32/lithium-codegen-ia32.cc ('k') | src/crankshaft/x87/lithium-codegen-x87.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: src/crankshaft/x64/lithium-codegen-x64.cc
diff --git a/src/crankshaft/x64/lithium-codegen-x64.cc b/src/crankshaft/x64/lithium-codegen-x64.cc
index dbabaa539d85c69cc2a74f30da97d263e80a7b77..350543ef88cf6042a8569eb92734ae79b4c14be3 100644
--- a/src/crankshaft/x64/lithium-codegen-x64.cc
+++ b/src/crankshaft/x64/lithium-codegen-x64.cc
@@ -3274,8 +3274,19 @@ void LCodeGen::DoDeferredMathAbsTaggedHeapNumber(LMathAbs* instr) {
DeoptimizeIf(not_equal, instr, Deoptimizer::kNotAHeapNumber);
Label slow, allocated, done;
- Register tmp = input_reg.is(rax) ? rcx : rax;
- Register tmp2 = tmp.is(rcx) ? rdx : input_reg.is(rcx) ? rdx : rcx;
+ uint32_t available_regs = rax.bit() | rcx.bit() | rdx.bit() | rbx.bit();
+ available_regs &= ~input_reg.bit();
+ if (instr->context()->IsRegister()) {
+ // Make sure that the context isn't overwritten in the AllocateHeapNumber
+ // macro below.
+ available_regs &= ~ToRegister(instr->context()).bit();
+ }
+
+ Register tmp =
+ Register::from_code(base::bits::CountTrailingZeros32(available_regs));
+ available_regs &= ~tmp.bit();
+ Register tmp2 =
+ Register::from_code(base::bits::CountTrailingZeros32(available_regs));
// Preserve the value of all registers.
PushSafepointRegistersScope scope(this);
« no previous file with comments | « src/crankshaft/ia32/lithium-codegen-ia32.cc ('k') | src/crankshaft/x87/lithium-codegen-x87.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698