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

Unified Diff: src/compiler/x87/code-generator-x87.cc

Issue 1586013006: X87: [turbofan] avoid xchg instruction on Intel. Base URL: https://chromium.googlesource.com/v8/v8.git@master
Patch Set: Created 4 years, 11 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/x87/lithium-gap-resolver-x87.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: src/compiler/x87/code-generator-x87.cc
diff --git a/src/compiler/x87/code-generator-x87.cc b/src/compiler/x87/code-generator-x87.cc
index f4e334dbb2624ab5f417a86349e065b3836d4f91..ec8f80971fcf6feae47777e35fafd5e5622bef47 100644
--- a/src/compiler/x87/code-generator-x87.cc
+++ b/src/compiler/x87/code-generator-x87.cc
@@ -1915,10 +1915,19 @@ void CodeGenerator::AssembleSwap(InstructionOperand* source,
// Register-register.
Register src = g.ToRegister(source);
Register dst = g.ToRegister(destination);
- __ xchg(dst, src);
+ __ push(src);
+ __ mov(src, dst);
+ __ pop(dst);
} else if (source->IsRegister() && destination->IsStackSlot()) {
// Register-memory.
- __ xchg(g.ToRegister(source), g.ToOperand(destination));
+ Register src = g.ToRegister(source);
+ __ push(src);
+ frame_access_state()->IncreaseSPDelta(1);
+ Operand dst = g.ToOperand(destination);
+ __ mov(src, dst);
+ frame_access_state()->IncreaseSPDelta(-1);
+ dst = g.ToOperand(destination);
+ __ pop(dst);
} else if (source->IsStackSlot() && destination->IsStackSlot()) {
// Memory-memory.
Operand dst1 = g.ToOperand(destination);
« no previous file with comments | « no previous file | src/crankshaft/x87/lithium-gap-resolver-x87.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698