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

Side by Side Diff: test/cctest/test-disasm-x64.cc

Issue 2623633003: [Atomics] Make Atomics.exchange a builtin using TF (Closed)
Patch Set: [Atomics] Make Atomics.exchange a builtin using TF Created 3 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
« src/x64/assembler-x64.cc ('K') | « src/x64/assembler-x64.cc ('k') | no next file » | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 // Copyright 2011 the V8 project authors. All rights reserved. 1 // Copyright 2011 the V8 project authors. All rights reserved.
2 // Redistribution and use in source and binary forms, with or without 2 // Redistribution and use in source and binary forms, with or without
3 // modification, are permitted provided that the following conditions are 3 // modification, are permitted provided that the following conditions are
4 // met: 4 // met:
5 // 5 //
6 // * Redistributions of source code must retain the above copyright 6 // * Redistributions of source code must retain the above copyright
7 // notice, this list of conditions and the following disclaimer. 7 // notice, this list of conditions and the following disclaimer.
8 // * Redistributions in binary form must reproduce the above 8 // * Redistributions in binary form must reproduce the above
9 // copyright notice, this list of conditions and the following 9 // copyright notice, this list of conditions and the following
10 // disclaimer in the documentation and/or other materials provided 10 // disclaimer in the documentation and/or other materials provided
(...skipping 888 matching lines...) Expand 10 before | Expand all | Expand 10 after
899 __ shrxl(rax, Operand(rbx, rcx, times_4, 10000), rbx); 899 __ shrxl(rax, Operand(rbx, rcx, times_4, 10000), rbx);
900 __ rorxq(rax, rbx, 63); 900 __ rorxq(rax, rbx, 63);
901 __ rorxq(rax, Operand(rbx, rcx, times_4, 10000), 63); 901 __ rorxq(rax, Operand(rbx, rcx, times_4, 10000), 63);
902 __ rorxl(rax, rbx, 31); 902 __ rorxl(rax, rbx, 31);
903 __ rorxl(rax, Operand(rbx, rcx, times_4, 10000), 31); 903 __ rorxl(rax, Operand(rbx, rcx, times_4, 10000), 31);
904 } 904 }
905 } 905 }
906 906
907 // xchg. 907 // xchg.
908 { 908 {
909 __ xchgb(rax, Operand(rax, 8)); 909 __ xchgb(rax, Operand(rax, 8), true);
910 __ xchgw(rax, Operand(rbx, 8)); 910 __ xchgw(rax, Operand(rbx, 8), true);
911 __ xchgq(rax, rax); 911 __ xchgq(rax, rax);
912 __ xchgq(rax, rbx); 912 __ xchgq(rax, rbx);
913 __ xchgq(rbx, rbx); 913 __ xchgq(rbx, rbx);
914 __ xchgq(rbx, Operand(rsp, 12)); 914 __ xchgq(rbx, Operand(rsp, 12));
915 } 915 }
916 916
917 // cmpxchg. 917 // cmpxchg.
918 { 918 {
919 __ cmpxchgb(Operand(rsp, 12), rax); 919 __ cmpxchgb(Operand(rsp, 12), rax);
920 __ cmpxchgw(Operand(rbx, rcx, times_4, 10000), rax); 920 __ cmpxchgw(Operand(rbx, rcx, times_4, 10000), rax);
921 __ cmpxchgl(Operand(rbx, rcx, times_4, 10000), rax); 921 __ cmpxchgl(Operand(rbx, rcx, times_4, 10000), rax);
922 __ cmpxchgq(Operand(rbx, rcx, times_4, 10000), rax); 922 __ cmpxchgq(Operand(rbx, rcx, times_4, 10000), rax);
923 } 923 }
924 924
925 // lock prefix. 925 // lock prefix.
926 { 926 {
927 __ lock(); 927 __ lock();
928 __ cmpxchgl(Operand(rsp, 12), rbx); 928 __ cmpxchgl(Operand(rsp, 12), rbx);
929 929
930 __ lock(); 930 __ lock();
931 __ xchgw(rax, Operand(rcx, 8)); 931 __ xchgw(rax, Operand(rcx, 8), true);
932 } 932 }
933 933
934 // Nop instructions 934 // Nop instructions
935 for (int i = 0; i < 16; i++) { 935 for (int i = 0; i < 16; i++) {
936 __ Nop(i); 936 __ Nop(i);
937 } 937 }
938 938
939 __ ret(0); 939 __ ret(0);
940 940
941 CodeDesc desc; 941 CodeDesc desc;
942 assm.GetCode(&desc); 942 assm.GetCode(&desc);
943 Handle<Code> code = isolate->factory()->NewCode( 943 Handle<Code> code = isolate->factory()->NewCode(
944 desc, Code::ComputeFlags(Code::STUB), Handle<Code>()); 944 desc, Code::ComputeFlags(Code::STUB), Handle<Code>());
945 USE(code); 945 USE(code);
946 #ifdef OBJECT_PRINT 946 #ifdef OBJECT_PRINT
947 OFStream os(stdout); 947 OFStream os(stdout);
948 code->Print(os); 948 code->Print(os);
949 byte* begin = code->instruction_start(); 949 byte* begin = code->instruction_start();
950 byte* end = begin + code->instruction_size(); 950 byte* end = begin + code->instruction_size();
951 disasm::Disassembler::Disassemble(stdout, begin, end); 951 disasm::Disassembler::Disassemble(stdout, begin, end);
952 #endif 952 #endif
953 } 953 }
954 954
955 #undef __ 955 #undef __
OLDNEW
« src/x64/assembler-x64.cc ('K') | « src/x64/assembler-x64.cc ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698