Chromium Code Reviews| Index: src/compiler/ia32/code-generator-ia32.cc |
| diff --git a/src/compiler/ia32/code-generator-ia32.cc b/src/compiler/ia32/code-generator-ia32.cc |
| index 9bb5a22cd19b45707165323321d109aaeca32cc9..f63bc22e4344fe65a875ea3c7cc341a98caa362a 100644 |
| --- a/src/compiler/ia32/code-generator-ia32.cc |
| +++ b/src/compiler/ia32/code-generator-ia32.cc |
| @@ -1616,10 +1616,19 @@ void CodeGenerator::AssembleSwap(InstructionOperand* source, |
| // Register-register. |
| Register src = g.ToRegister(source); |
| Register dst = g.ToRegister(destination); |
| - __ xchg(dst, src); |
| + __ push(src); |
|
yosin_UTC9
2016/01/20 01:48:18
Just a curiosity, why don't you use XOR-technique
|
| + __ 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); |