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

Unified Diff: src/crankshaft/ia32/lithium-codegen-ia32.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
« no previous file with comments | « no previous file | src/crankshaft/x64/lithium-codegen-x64.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: src/crankshaft/ia32/lithium-codegen-ia32.cc
diff --git a/src/crankshaft/ia32/lithium-codegen-ia32.cc b/src/crankshaft/ia32/lithium-codegen-ia32.cc
index 00761c4857a6467208403bd16cb59253dc4fec50..f806e462f0edd04858c9515ec0cd9949cea01122 100644
--- a/src/crankshaft/ia32/lithium-codegen-ia32.cc
+++ b/src/crankshaft/ia32/lithium-codegen-ia32.cc
@@ -3075,6 +3075,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;
+ }
+ }
Jarin 2016/06/03 13:54:56 It is not obvious that tmp/tmp2 cannot alias the i
epertoso 2016/06/03 15:39:06 Changed it a bit. Feel free to Commit if you still
+
// Preserve the value of all registers.
PushSafepointRegistersScope scope(this);
« no previous file with comments | « no previous file | src/crankshaft/x64/lithium-codegen-x64.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698