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

Side by Side Diff: src/compiler/ia32/code-generator-ia32.cc

Issue 2649703002: [Atomics] Make Atomics.compareExchange a builtin using TF (Closed)
Patch Set: rebase and move cmpxchg to builtins-sharedarraybuffer-gen.cc Created 3 years, 9 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 2013 the V8 project authors. All rights reserved. 1 // Copyright 2013 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 #include "src/compiler/code-generator.h" 5 #include "src/compiler/code-generator.h"
6 6
7 #include "src/compilation-info.h" 7 #include "src/compilation-info.h"
8 #include "src/compiler/code-generator-impl.h" 8 #include "src/compiler/code-generator-impl.h"
9 #include "src/compiler/gap-resolver.h" 9 #include "src/compiler/gap-resolver.h"
10 #include "src/compiler/node-matchers.h" 10 #include "src/compiler/node-matchers.h"
(...skipping 1969 matching lines...) Expand 10 before | Expand all | Expand 10 after
1980 } 1980 }
1981 case kAtomicExchangeUint16: { 1981 case kAtomicExchangeUint16: {
1982 __ xchg_w(i.InputRegister(0), i.MemoryOperand(1)); 1982 __ xchg_w(i.InputRegister(0), i.MemoryOperand(1));
1983 __ movzx_w(i.InputRegister(0), i.InputRegister(0)); 1983 __ movzx_w(i.InputRegister(0), i.InputRegister(0));
1984 break; 1984 break;
1985 } 1985 }
1986 case kAtomicExchangeWord32: { 1986 case kAtomicExchangeWord32: {
1987 __ xchg(i.InputRegister(0), i.MemoryOperand(1)); 1987 __ xchg(i.InputRegister(0), i.MemoryOperand(1));
1988 break; 1988 break;
1989 } 1989 }
1990 case kAtomicCompareExchangeInt8: {
1991 __ lock();
1992 __ cmpxchg_b(i.MemoryOperand(2), i.InputRegister(1));
1993 __ movsx_b(eax, eax);
1994 break;
1995 }
1996 case kAtomicCompareExchangeUint8: {
1997 __ lock();
1998 __ cmpxchg_b(i.MemoryOperand(2), i.InputRegister(1));
1999 __ movzx_b(eax, eax);
2000 break;
2001 }
2002 case kAtomicCompareExchangeInt16: {
2003 __ lock();
2004 __ cmpxchg_w(i.MemoryOperand(2), i.InputRegister(1));
2005 __ movsx_w(eax, eax);
2006 break;
2007 }
2008 case kAtomicCompareExchangeUint16: {
2009 __ lock();
2010 __ cmpxchg_w(i.MemoryOperand(2), i.InputRegister(1));
2011 __ movzx_w(eax, eax);
2012 break;
2013 }
2014 case kAtomicCompareExchangeWord32: {
2015 __ lock();
2016 __ cmpxchg(i.MemoryOperand(2), i.InputRegister(1));
2017 break;
2018 }
1990 case kAtomicLoadInt8: 2019 case kAtomicLoadInt8:
1991 case kAtomicLoadUint8: 2020 case kAtomicLoadUint8:
1992 case kAtomicLoadInt16: 2021 case kAtomicLoadInt16:
1993 case kAtomicLoadUint16: 2022 case kAtomicLoadUint16:
1994 case kAtomicLoadWord32: 2023 case kAtomicLoadWord32:
1995 case kAtomicStoreWord8: 2024 case kAtomicStoreWord8:
1996 case kAtomicStoreWord16: 2025 case kAtomicStoreWord16:
1997 case kAtomicStoreWord32: 2026 case kAtomicStoreWord32:
1998 UNREACHABLE(); // Won't be generated by instruction selector. 2027 UNREACHABLE(); // Won't be generated by instruction selector.
1999 break; 2028 break;
(...skipping 701 matching lines...) Expand 10 before | Expand all | Expand 10 after
2701 int padding_size = last_lazy_deopt_pc_ + space_needed - current_pc; 2730 int padding_size = last_lazy_deopt_pc_ + space_needed - current_pc;
2702 __ Nop(padding_size); 2731 __ Nop(padding_size);
2703 } 2732 }
2704 } 2733 }
2705 2734
2706 #undef __ 2735 #undef __
2707 2736
2708 } // namespace compiler 2737 } // namespace compiler
2709 } // namespace internal 2738 } // namespace internal
2710 } // namespace v8 2739 } // namespace v8
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698