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

Side by Side Diff: src/crankshaft/ia32/lithium-gap-resolver-ia32.cc

Issue 1580233003: [turbofan] avoid xchg instruction on Intel (Closed) 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 unified diff | Download patch
OLDNEW
1 // Copyright 2011 the V8 project authors. All rights reserved. 1 // Copyright 2011 the V8 project authors. All rights reserved.
2 // Use of this source code is governed by a BSD-style license that can be 2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file. 3 // found in the LICENSE file.
4 4
5 #if V8_TARGET_ARCH_IA32 5 #if V8_TARGET_ARCH_IA32
6 6
7 #include "src/crankshaft/ia32/lithium-codegen-ia32.h" 7 #include "src/crankshaft/ia32/lithium-codegen-ia32.h"
8 #include "src/crankshaft/ia32/lithium-gap-resolver-ia32.h" 8 #include "src/crankshaft/ia32/lithium-gap-resolver-ia32.h"
9 #include "src/register-configuration.h" 9 #include "src/register-configuration.h"
10 10
(...skipping 351 matching lines...) Expand 10 before | Expand all | Expand 10 after
362 LOperand* destination = moves_[index].destination(); 362 LOperand* destination = moves_[index].destination();
363 EnsureRestored(source); 363 EnsureRestored(source);
364 EnsureRestored(destination); 364 EnsureRestored(destination);
365 365
366 // Dispatch on the source and destination operand kinds. Not all 366 // Dispatch on the source and destination operand kinds. Not all
367 // combinations are possible. 367 // combinations are possible.
368 if (source->IsRegister() && destination->IsRegister()) { 368 if (source->IsRegister() && destination->IsRegister()) {
369 // Register-register. 369 // Register-register.
370 Register src = cgen_->ToRegister(source); 370 Register src = cgen_->ToRegister(source);
371 Register dst = cgen_->ToRegister(destination); 371 Register dst = cgen_->ToRegister(destination);
372 __ xchg(dst, src); 372 __ push(src);
373 __ mov(src, dst);
374 __ pop(dst);
373 375
374 } else if ((source->IsRegister() && destination->IsStackSlot()) || 376 } else if ((source->IsRegister() && destination->IsStackSlot()) ||
375 (source->IsStackSlot() && destination->IsRegister())) { 377 (source->IsStackSlot() && destination->IsRegister())) {
376 // Register-memory. Use a free register as a temp if possible. Do not 378 // Register-memory. Use a free register as a temp if possible. Do not
377 // spill on demand because the simple spill implementation cannot avoid 379 // spill on demand because the simple spill implementation cannot avoid
378 // spilling src at this point. 380 // spilling src at this point.
379 Register tmp = GetFreeRegisterNot(no_reg); 381 Register tmp = GetFreeRegisterNot(no_reg);
380 Register reg = 382 Register reg =
381 cgen_->ToRegister(source->IsRegister() ? source : destination); 383 cgen_->ToRegister(source->IsRegister() ? source : destination);
382 Operand mem = 384 Operand mem =
(...skipping 99 matching lines...) Expand 10 before | Expand all | Expand 10 after
482 source_uses_[destination->index()] = CountSourceUses(destination); 484 source_uses_[destination->index()] = CountSourceUses(destination);
483 } 485 }
484 } 486 }
485 487
486 #undef __ 488 #undef __
487 489
488 } // namespace internal 490 } // namespace internal
489 } // namespace v8 491 } // namespace v8
490 492
491 #endif // V8_TARGET_ARCH_IA32 493 #endif // V8_TARGET_ARCH_IA32
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698