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

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

Issue 2033413002: [crankshaft] Fix DoDeferredMathAbsTaggedHeapNumber overwriting the context with some temporary valu… (Closed) Base URL: https://chromium.googlesource.com/v8/v8.git@master
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
Index: src/crankshaft/x87/lithium-codegen-x87.cc
diff --git a/src/crankshaft/x87/lithium-codegen-x87.cc b/src/crankshaft/x87/lithium-codegen-x87.cc
index fe39fbf8e57c88eb1415f8ec142578e1bd1681b5..4731581fdfd75fedb238aaf0a16361ee6b0703f9 100644
--- a/src/crankshaft/x87/lithium-codegen-x87.cc
+++ b/src/crankshaft/x87/lithium-codegen-x87.cc
@@ -3351,6 +3351,17 @@ void LCodeGen::DoDeferredMathAbsTaggedHeapNumber(LMathAbs* instr) {
Register tmp = input_reg.is(eax) ? ecx : eax;
Register tmp2 = tmp.is(ecx) ? edx : input_reg.is(ecx) ? edx : ecx;
+ // Make sure that the context isn't overwritten in the AllocateHeapNumber
+ // macro below.
+ if (instr->context()->IsRegister()) {
+ Register context_reg = ToRegister(instr->context());
+ if (tmp.is(context_reg)) {
+ tmp = ebx;
+ } else if (tmp2.is(context_reg)) {
+ tmp2 = ebx;
+ }
+ }
+
// Preserve the value of all registers.
PushSafepointRegistersScope scope(this);
« src/crankshaft/ia32/lithium-codegen-ia32.cc ('K') | « src/crankshaft/x64/lithium-codegen-x64.cc ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698