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

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

Issue 2649703002: [Atomics] Make Atomics.compareExchange a builtin using TF (Closed)
Patch Set: dmb 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 <limits> 7 #include <limits>
8 8
9 #include "src/compilation-info.h" 9 #include "src/compilation-info.h"
10 #include "src/compiler/code-generator-impl.h" 10 #include "src/compiler/code-generator-impl.h"
(...skipping 2225 matching lines...) Expand 10 before | Expand all | Expand 10 after
2236 } 2236 }
2237 case kAtomicExchangeUint16: { 2237 case kAtomicExchangeUint16: {
2238 __ xchgw(i.InputRegister(0), i.MemoryOperand(1)); 2238 __ xchgw(i.InputRegister(0), i.MemoryOperand(1));
2239 __ movzxwl(i.InputRegister(0), i.InputRegister(0)); 2239 __ movzxwl(i.InputRegister(0), i.InputRegister(0));
2240 break; 2240 break;
2241 } 2241 }
2242 case kAtomicExchangeWord32: { 2242 case kAtomicExchangeWord32: {
2243 __ xchgl(i.InputRegister(0), i.MemoryOperand(1)); 2243 __ xchgl(i.InputRegister(0), i.MemoryOperand(1));
2244 break; 2244 break;
2245 } 2245 }
2246 case kAtomicCompareExchangeInt8: {
2247 __ cmpxchgb(i.MemoryOperand(2), i.InputRegister(1));
2248 __ movsxbl(rax, rax);
2249 break;
2250 }
2251 case kAtomicCompareExchangeUint8: {
2252 __ cmpxchgb(i.MemoryOperand(2), i.InputRegister(1));
2253 __ movzxbl(rax, rax);
2254 break;
2255 }
2256 case kAtomicCompareExchangeInt16: {
2257 __ cmpxchgw(i.MemoryOperand(2), i.InputRegister(1));
2258 __ movsxwl(rax, rax);
2259 break;
2260 }
2261 case kAtomicCompareExchangeUint16: {
2262 __ cmpxchgw(i.MemoryOperand(2), i.InputRegister(1));
2263 __ movzxwl(rax, rax);
2264 break;
2265 }
2266 case kAtomicCompareExchangeWord32: {
2267 __ cmpxchgl(i.MemoryOperand(2), i.InputRegister(1));
2268 break;
2269 }
2246 case kAtomicLoadInt8: 2270 case kAtomicLoadInt8:
2247 case kAtomicLoadUint8: 2271 case kAtomicLoadUint8:
2248 case kAtomicLoadInt16: 2272 case kAtomicLoadInt16:
2249 case kAtomicLoadUint16: 2273 case kAtomicLoadUint16:
2250 case kAtomicLoadWord32: 2274 case kAtomicLoadWord32:
2251 case kAtomicStoreWord8: 2275 case kAtomicStoreWord8:
2252 case kAtomicStoreWord16: 2276 case kAtomicStoreWord16:
2253 case kAtomicStoreWord32: 2277 case kAtomicStoreWord32:
2254 UNREACHABLE(); // Won't be generated by instruction selector. 2278 UNREACHABLE(); // Won't be generated by instruction selector.
2255 break; 2279 break;
(...skipping 617 matching lines...) Expand 10 before | Expand all | Expand 10 after
2873 int padding_size = last_lazy_deopt_pc_ + space_needed - current_pc; 2897 int padding_size = last_lazy_deopt_pc_ + space_needed - current_pc;
2874 __ Nop(padding_size); 2898 __ Nop(padding_size);
2875 } 2899 }
2876 } 2900 }
2877 2901
2878 #undef __ 2902 #undef __
2879 2903
2880 } // namespace compiler 2904 } // namespace compiler
2881 } // namespace internal 2905 } // namespace internal
2882 } // namespace v8 2906 } // namespace v8
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698